Skip to content

Commit

Permalink
fix all
Browse files Browse the repository at this point in the history
  • Loading branch information
jjh4450 committed Sep 15, 2024
1 parent ee3745c commit b48540f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
10 changes: 3 additions & 7 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +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 @@ -100,9 +98,7 @@ export const Header: React.FC = () => {
<Link
to={item.path}
className={`${menuItemLinkStyles} ${
isCurrentPath(item.path, location.pathname)
? highlightStyles
: ""
isCurrentPath(item.path, location.pathname) ? highlightStyles : ""
}`}
onClick={handleToggle}
>
Expand All @@ -116,4 +112,4 @@ export const Header: React.FC = () => {
);
};

export default Header;
export default Header;
2 changes: 1 addition & 1 deletion src/shared/routing/RouterInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [

Check warning on line 13 in src/shared/routing/RouterInfo.tsx

View workflow job for this annotation

GitHub Actions / CI

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
{
path: "/",
element: <Main />,
Expand Down
5 changes: 2 additions & 3 deletions src/shared/types/Route.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

// 라우팅 정보 객체 타입
export interface RouterInfoType {
export interface RouterInfoType {
path: string;
element: React.ReactElement;
english: string;
korean: string;
expose: boolean;
}
}

0 comments on commit b48540f

Please sign in to comment.