diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx new file mode 100644 index 0000000..959781f --- /dev/null +++ b/src/components/Footer.tsx @@ -0,0 +1,41 @@ +import Link from "next/link"; +import Image from "next/image"; +import { FaGithub } from "react-icons/fa"; + +export default function Footer() { + return ( + + ); +} + diff --git a/src/components/Header.tsx b/src/components/Header.tsx new file mode 100644 index 0000000..5bc4b6b --- /dev/null +++ b/src/components/Header.tsx @@ -0,0 +1,39 @@ +import Link from "next/link"; +import Image from "next/image"; + +export default function Header() { + return ( +
+ + My Site Logo + + +
+ ); +} diff --git a/src/layouts/Home.tsx b/src/layouts/Home.tsx new file mode 100644 index 0000000..d3395e6 --- /dev/null +++ b/src/layouts/Home.tsx @@ -0,0 +1,38 @@ +import Head from "next/head"; +import Header from "@/components/Header"; +import Footer from "@/components/Footer"; + +export default function Layout({ children, title }: { children: React.ReactNode, title?: string }) { + const newTitle = title ? title + " | " : ""; + return ( +
+ + {newTitle + "Photo Club Haute Lozère"} + + + + + + + + + + + + + + + + + + + + + +
+
{children}
+
+ ); +} + diff --git a/src/pages/index.tsx b/src/pages/index.tsx index cfd9194..b413bdc 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,115 +1,5 @@ import Image from "next/image"; -import Link from "next/link"; -import Head from "next/head"; -import { FaGithub } from "react-icons/fa"; - -function Header() { - return ( -
- - My Site Logo - - -
- ); -} - -function Footer() { - return ( - - ); -} - -function Layout({ children, title }: { children: React.ReactNode, title?: string }) { - const newTitle = title ? title + " | " : ""; - return ( -
- - {newTitle + "Photo Club Haute Lozère"} - - - - - - - - - - - - - - - - - - - - - -
-
{children}
-
- ); -} +import Layout from "@/layouts/Home"; function Home() { return ( @@ -190,5 +80,3 @@ function Home() { } export default Home; - -export { Layout }; diff --git a/tsconfig.json b/tsconfig.json index 658068a..7db101f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,10 @@ "isolatedModules": true, "jsx": "preserve", "incremental": true, - "noUncheckedIndexedAccess": true + "noUncheckedIndexedAccess": true, + "paths": { + "@/*": ["src/*"] + } }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.cjs", "**/*.mjs"], "exclude": ["node_modules"]