Skip to content

Commit

Permalink
style(route): camelCase로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
jjh4450 committed Sep 16, 2024
1 parent b48540f commit 328b181
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import Layout from "./components/Layout";
import RouterInfo from "./shared/routing/RouterInfo.tsx";
import routerInfo from "./shared/routing/routerInfo.tsx";

const RouterPath = RouterInfo.map((info) => {
const RouterPath = routerInfo.map((info) => {
return {
path: info.path,
element: info.element,
Expand Down
10 changes: 5 additions & 5 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useCallback, useEffect, useRef, useState } from "react";
import { Link, matchPath, useLocation } from "react-router-dom";
import RouterInfo from "../../shared/routing/RouterInfo";
import routerInfo from "../../shared/routing/routerInfo.tsx";
import Logo from "../../assets/logo.svg?react";
import Menu from "../../assets/menu_buton.json";
import {
Expand All @@ -14,7 +14,7 @@ import {
menuStyles,
toggleBtnStyles,
} from "./.css.ts";
import { RouterInfoType } from "../../shared/types/Route";
import { routerInfoType } from "../../shared/types/routing.ts";
import Lottie, { LottieRefCurrentProps } from "lottie-react";

/**
Expand Down Expand Up @@ -62,7 +62,7 @@ export const Header: React.FC = () => {
* 컴포넌트가 마운트될 때 현재 페이지를 설정하고, isActive를 false로 초기화함
*/
useEffect(() => {
const currentRoute = RouterInfo.find((route) => isCurrentPath(route.path, location.pathname));
const currentRoute = routerInfo.find((route) => isCurrentPath(route.path, location.pathname));
setCurrentPage(currentRoute?.korean ?? "/");
setIsActive(false);
lottieRef.current?.setSpeed(1.5);
Expand Down Expand Up @@ -91,8 +91,8 @@ export const Header: React.FC = () => {
{/*페이지 메뉴*/}
<nav className={`${menuStyles} ${isActive ? "active" : ""}`}>
<ul className={menuListStyles}>
{RouterInfo.filter((item) => item.expose)
.sort((a: RouterInfoType, b: RouterInfoType) => a.korean.localeCompare(b.korean))
{routerInfo.filter((item) => item.expose)
.sort((a: routerInfoType, b: routerInfoType) => a.korean.localeCompare(b.korean))
.map((item) => (
<li key={item.path} className={menuItemStyles}>
<Link
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RouterInfoType } from "../types/Route.ts";
import { routerInfoType } from "../types/routing.ts";
import Main from "../../pages/Main";
import Artist from "../../pages/Artist";
import Booth from "../../pages/Booth";
Expand All @@ -10,7 +10,7 @@ import Notice from "../../pages/Notice";
import QnA from "../../pages/QnA";
import Timetable from "../../pages/Timetable";

export const RouterInfo: RouterInfoType[] = [
export const routerInfo: routerInfoType[] = [
{
path: "/",
element: <Main />,
Expand Down Expand Up @@ -83,4 +83,4 @@ export const RouterInfo: RouterInfoType[] = [
},
];

export default RouterInfo;
export default routerInfo;
2 changes: 1 addition & 1 deletion src/shared/types/Route.ts → src/shared/types/routing.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 라우팅 정보 객체 타입
export interface RouterInfoType {
export interface routerInfoType {
path: string;
element: React.ReactElement;
english: string;
Expand Down

0 comments on commit 328b181

Please sign in to comment.