From 7ad6c6a2a454c8abec4958f859bb5aacf0b213f1 Mon Sep 17 00:00:00 2001 From: hexi1997 <18715156450@163.com> Date: Sat, 1 Jul 2023 15:03:12 +0800 Subject: [PATCH 1/3] chore: add paths on tsconfig --- tsconfig.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index e4b81e9..8133513 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,12 @@ "moduleResolution": "Node", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve" + "jsx": "preserve", + "paths": { + "@/*": [ + "./*" + ] + } }, "include": [ "next-env.d.ts", @@ -26,5 +31,6 @@ ], "exclude": [ "node_modules" - ] + ], + } From 73719cc5c723c40c2055fbd26c716c6e780954fd Mon Sep 17 00:00:00 2001 From: hexi1997 <18715156450@163.com> Date: Sat, 1 Jul 2023 15:14:43 +0800 Subject: [PATCH 2/3] feat: extract app-layout and footer component --- components/app-layout.tsx | 14 ++++++++++++++ components/footer.tsx | 34 ++++++++++++++++++++++++++++++++++ components/index.tsx | 2 ++ pages/_app.tsx | 7 ++++++- pages/index.tsx | 34 ++-------------------------------- 5 files changed, 58 insertions(+), 33 deletions(-) create mode 100644 components/app-layout.tsx create mode 100644 components/footer.tsx create mode 100644 components/index.tsx diff --git a/components/app-layout.tsx b/components/app-layout.tsx new file mode 100644 index 0000000..d0d48be --- /dev/null +++ b/components/app-layout.tsx @@ -0,0 +1,14 @@ +import { ReactNode } from "react"; +import { Footer } from "./footer"; + +interface IAppLayoutProps { + children: ReactNode; +} +export function AppLayout({ children }: IAppLayoutProps) { + return ( + <> +
{children}
+ + ); +}