Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jjh4450 committed Sep 15, 2024
1 parent 213727f commit e928313
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 72 deletions.
4 changes: 2 additions & 2 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useRef, useState, useCallback } from "react";
import React, { useCallback, useEffect, useRef, useState } from "react";
import { Link, matchPath, useLocation } from "react-router-dom";
import RouterInfo from "../../shared/routing/RouterInfo";
import Logo from "../../assets/logo.svg?react";
Expand Down Expand Up @@ -63,7 +63,7 @@ export const Header: React.FC = () => {
*/
useEffect(() => {
const currentRoute = RouterInfo.find((route) =>
isCurrentPath(route.path, location.pathname)
isCurrentPath(route.path, location.pathname),
);
setCurrentPage(currentRoute?.korean ?? "/");
setIsActive(false);
Expand Down
140 changes: 70 additions & 70 deletions src/shared/routing/RouterInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,76 +11,76 @@ import QnA from "../../pages/QnA";
import Timetable from "../../pages/Timetable";

export const RouterInfo: RouterInfoType [] = [
{
path: "/",
element: <Main />,
english: "Main",
korean: "메인",
expose: true,
},
{
path: "artist/:id",
element: <Artist />,
english: "Artist",
korean: "아티스트",
expose: false,
},
{
path: "booth/:id",
element: <Booth />,
english: "Booth",
korean: "부스",
expose: false,
},
{
path: "booth_foodtruck_list",
element: <BoothNFoodList />,
english: "Booth & Foodtruck List",
korean: "부스 & 푸드트럭 리스트",
expose: true,
},
{
path: "foodtruck/:id",
element: <Foodtruck />,
english: "Foodtruck",
korean: "푸드트럭",
expose: false,
},
{
path: "makers",
element: <Makers />,
english: "Makers",
korean: "메이커스",
expose: false,
},
{
path: "map",
element: <Map />,
english: "Map",
korean: "지도",
expose: true,
},
{
path: "notice",
element: <Notice />,
english: "Notice",
korean: "공지사항",
expose: true,
},
{
path: "QnA",
element: <QnA />,
english: "QnA",
korean: "QnA",
expose: true,
},
{
path: "timetable",
element: <Timetable />,
english: "Timetable",
korean: "타임테이블",
expose: true,
},
{
path: "/",
element: <Main />,
english: "Main",
korean: "메인",
expose: true,
},
{
path: "artist/:id",
element: <Artist />,
english: "Artist",
korean: "아티스트",
expose: false,
},
{
path: "booth/:id",
element: <Booth />,
english: "Booth",
korean: "부스",
expose: false,
},
{
path: "booth_foodtruck_list",
element: <BoothNFoodList />,
english: "Booth & Foodtruck List",
korean: "부스 & 푸드트럭 리스트",
expose: true,
},
{
path: "foodtruck/:id",
element: <Foodtruck />,
english: "Foodtruck",
korean: "푸드트럭",
expose: false,
},
{
path: "makers",
element: <Makers />,
english: "Makers",
korean: "메이커스",
expose: false,
},
{
path: "map",
element: <Map />,
english: "Map",
korean: "지도",
expose: true,
},
{
path: "notice",
element: <Notice />,
english: "Notice",
korean: "공지사항",
expose: true,
},
{
path: "QnA",
element: <QnA />,
english: "QnA",
korean: "QnA",
expose: true,
},
{
path: "timetable",
element: <Timetable />,
english: "Timetable",
korean: "타임테이블",
expose: true,
},
];

export default RouterInfo;

0 comments on commit e928313

Please sign in to comment.