From ab95d0cf14fc0e8d7e04bc7495bc518bb6f93461 Mon Sep 17 00:00:00 2001 From: wo-o29 Date: Thu, 1 Aug 2024 21:39:53 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=ED=97=A4=EB=8D=94=20=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=EC=95=84=EC=9B=83=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/.gitkeep | 0 src/components/Layout/HeaderLayout/index.tsx | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) delete mode 100644 src/components/.gitkeep create mode 100644 src/components/Layout/HeaderLayout/index.tsx diff --git a/src/components/.gitkeep b/src/components/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/Layout/HeaderLayout/index.tsx b/src/components/Layout/HeaderLayout/index.tsx new file mode 100644 index 0000000..bc3f533 --- /dev/null +++ b/src/components/Layout/HeaderLayout/index.tsx @@ -0,0 +1,16 @@ +import { ReactNode } from "react"; + +interface HeaderLayoutProps { + children: ReactNode; +} + +function HeaderLayout({ children }: HeaderLayoutProps) { + return ( + <> +
추후 헤더 완성되면 만들어진 헤더 사용 예정
+
{children}
+ + ); +} + +export default HeaderLayout; From 1c8845cc30fa9d3e5225dea05e2589a6de1111c0 Mon Sep 17 00:00:00 2001 From: wo-o29 Date: Thu, 1 Aug 2024 21:48:23 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=EB=A0=88=EC=9D=B4=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/_app.page.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/pages/_app.page.tsx b/src/pages/_app.page.tsx index f2c412e..ac12fc3 100644 --- a/src/pages/_app.page.tsx +++ b/src/pages/_app.page.tsx @@ -1,13 +1,22 @@ import type { AppProps } from "next/app"; +import { NextPage } from "next/types"; -import { useState } from "react"; +import { ReactElement, ReactNode, useState } from "react"; import { Global } from "@emotion/react"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import reset from "@/styles/reset"; -export default function App({ Component, pageProps }: AppProps) { +export type NextPageWithLayout

= NextPage & { + getLayout?: (page: ReactElement) => ReactNode; +}; + +interface AppPropsWithLayout extends AppProps { + Component: NextPageWithLayout; // components 속성이 NextPageWithLayout 타입을 따르도록 변경 +} + +export default function App({ Component, pageProps }: AppPropsWithLayout) { const [queryClient] = useState( () => new QueryClient({ @@ -22,10 +31,12 @@ export default function App({ Component, pageProps }: AppProps) { }), ); + const getLayout = Component.getLayout ?? ((page) => page); + return ( - + {getLayout()} ); } From 3bf29c95143dadfc4cae6cf51afe116181a9eda8 Mon Sep 17 00:00:00 2001 From: wo-o29 Date: Fri, 2 Aug 2024 18:18:37 +0900 Subject: [PATCH 3/3] =?UTF-8?q?refactor:=20=EB=A0=88=EC=9D=B4=EC=95=84?= =?UTF-8?q?=EC=9B=83=20main=20=ED=83=9C=EA=B7=B8=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Layout/HeaderLayout/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Layout/HeaderLayout/index.tsx b/src/components/Layout/HeaderLayout/index.tsx index bc3f533..d6c1e67 100644 --- a/src/components/Layout/HeaderLayout/index.tsx +++ b/src/components/Layout/HeaderLayout/index.tsx @@ -8,7 +8,7 @@ function HeaderLayout({ children }: HeaderLayoutProps) { return ( <>

추후 헤더 완성되면 만들어진 헤더 사용 예정
-
{children}
+ {children} ); }