From e9283138bb13596eca3cffb36a57818b6cc892c3 Mon Sep 17 00:00:00 2001 From: jjh4450 Date: Sun, 15 Sep 2024 22:54:59 +0900 Subject: [PATCH] refactor --- src/components/Header/index.tsx | 4 +- src/shared/routing/RouterInfo.tsx | 140 +++++++++++++++--------------- 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 9444b19..726a165 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -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"; @@ -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); diff --git a/src/shared/routing/RouterInfo.tsx b/src/shared/routing/RouterInfo.tsx index d956816..c9055eb 100644 --- a/src/shared/routing/RouterInfo.tsx +++ b/src/shared/routing/RouterInfo.tsx @@ -11,76 +11,76 @@ import QnA from "../../pages/QnA"; import Timetable from "../../pages/Timetable"; export const RouterInfo: RouterInfoType [] = [ - { - path: "/", - element:
, - english: "Main", - korean: "메인", - expose: true, - }, - { - path: "artist/:id", - element: , - english: "Artist", - korean: "아티스트", - expose: false, - }, - { - path: "booth/:id", - element: , - english: "Booth", - korean: "부스", - expose: false, - }, - { - path: "booth_foodtruck_list", - element: , - english: "Booth & Foodtruck List", - korean: "부스 & 푸드트럭 리스트", - expose: true, - }, - { - path: "foodtruck/:id", - element: , - english: "Foodtruck", - korean: "푸드트럭", - expose: false, - }, - { - path: "makers", - element: , - english: "Makers", - korean: "메이커스", - expose: false, - }, - { - path: "map", - element: , - english: "Map", - korean: "지도", - expose: true, - }, - { - path: "notice", - element: , - english: "Notice", - korean: "공지사항", - expose: true, - }, - { - path: "QnA", - element: , - english: "QnA", - korean: "QnA", - expose: true, - }, - { - path: "timetable", - element: , - english: "Timetable", - korean: "타임테이블", - expose: true, - }, + { + path: "/", + element:
, + english: "Main", + korean: "메인", + expose: true, + }, + { + path: "artist/:id", + element: , + english: "Artist", + korean: "아티스트", + expose: false, + }, + { + path: "booth/:id", + element: , + english: "Booth", + korean: "부스", + expose: false, + }, + { + path: "booth_foodtruck_list", + element: , + english: "Booth & Foodtruck List", + korean: "부스 & 푸드트럭 리스트", + expose: true, + }, + { + path: "foodtruck/:id", + element: , + english: "Foodtruck", + korean: "푸드트럭", + expose: false, + }, + { + path: "makers", + element: , + english: "Makers", + korean: "메이커스", + expose: false, + }, + { + path: "map", + element: , + english: "Map", + korean: "지도", + expose: true, + }, + { + path: "notice", + element: , + english: "Notice", + korean: "공지사항", + expose: true, + }, + { + path: "QnA", + element: , + english: "QnA", + korean: "QnA", + expose: true, + }, + { + path: "timetable", + element: , + english: "Timetable", + korean: "타임테이블", + expose: true, + }, ]; export default RouterInfo;