diff --git a/src/App.tsx b/src/App.tsx index b865557..f96b6ba 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,6 +8,8 @@ import { import { QueryClient, QueryClientProvider } from "react-query"; import Layout from "@/components/Layout/Layout.tsx"; import { IRoute, Pages } from "@/types/route.ts"; +import NotFound from "@/pages/404"; + const pages: Pages = import.meta.glob("./pages/**/*.tsx", { eager: true }); const routes: IRoute[] = []; @@ -41,13 +43,19 @@ const router = createBrowserRouter([ { path: "/", // Layout의 루트 경로 element: , - children: routes.map(({ Element, ErrorBoundary, ...rest }) => ({ - ...rest, - element: , - ...(ErrorBoundary && { - errorElement: React.createElement(ErrorBoundary), - }), - })), + children: [ + ...routes.map(({ Element, ErrorBoundary, ...rest }) => ({ + ...rest, + element: , + ...(ErrorBoundary && { + errorElement: React.createElement(ErrorBoundary), + }), + })), + { + path: "*", + element: , + }, + ], }, ]); diff --git a/src/components/AboutTable/AboutTable.tsx b/src/components/AboutTable/AboutTable.tsx index 4c3e359..5232c3b 100644 --- a/src/components/AboutTable/AboutTable.tsx +++ b/src/components/AboutTable/AboutTable.tsx @@ -1,27 +1,38 @@ import { useNavigate } from "react-router-dom"; +import { FaThumbtack } from "react-icons/fa"; interface Column { label: string; value: string; + size: string; } -interface AboutTableProps { +interface AboutTableProps { columns: Column[]; data: T[]; + moveToDetail: (row: T) => void; } -export const AboutTable = ({ +export const AboutTable = ({ columns, data, + moveToDetail, }: AboutTableProps) => { - const nav = useNavigate(); - const moveToDetail = (row: T) => { - nav(`/board/notice/${row.id}`); - }; + + // 고정된 항목과 일반 항목을 분리 + const pinnedItems = data.filter((item: any) => item.is_pinned); + const normalItems = data.filter((item: any) => !item.is_pinned); + return (
+ + {columns.map((column, index) => ( + + ))} + + {columns.map((column, index) => ( @@ -35,9 +46,27 @@ export const AboutTable = ({ - {data.map((row, rowIndex) => ( + {/* 고정된 항목 먼저 표시 */} + {pinnedItems.map((row, rowIndex) => ( + moveToDetail(row)} + > + {columns.map((column, index) => ( + + ))} + + ))} + {/* 일반 항목 표시 */} + {normalItems.map((row, rowIndex) => ( moveToDetail(row)} > diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index f317210..65e4cda 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -26,6 +26,11 @@ const menuItems = [ { label: "MD", path: "/about/md" }, ], }, + { + label: "COC", + hasDropdown: false, + path: "/coc", + }, /* { label: "NEWS", hasDropdown: false }, { label: "SUPPORT", hasDropdown: false }, { label: "COC", hasDropdown: false },*/ @@ -63,13 +68,17 @@ const Header = ({ backgroundColor, textColor }: HeaderProps) => { {/* 데스크탑 네비게이션 */}
+ {column.value === "pin" ? : String(row[column.value as keyof T] ?? "-")} +