From 1866dc3a8414d64828257d7f8a4c19fe3dae0b1e Mon Sep 17 00:00:00 2001 From: Hri7566 Date: Thu, 14 Sep 2023 00:48:52 -0400 Subject: [PATCH] Add root layout and remove per-page layout --- src/components/layout.tsx | 33 ++++++++++++++++++ src/pages/_app.tsx | 5 ++- src/pages/about.tsx | 73 +++++++++++---------------------------- src/pages/index.tsx | 66 +++++++++-------------------------- src/pages/team.tsx | 61 +++++++++----------------------- 5 files changed, 90 insertions(+), 148 deletions(-) create mode 100644 src/components/layout.tsx diff --git a/src/components/layout.tsx b/src/components/layout.tsx new file mode 100644 index 0000000..1b64cea --- /dev/null +++ b/src/components/layout.tsx @@ -0,0 +1,33 @@ +import Head from "next/head"; + +export default function Layout({ children }: { children: React.ReactNode }) { + const bgs = [ + "/bg/webp/bg1.webp", + "/bg/webp/bg2.webp", + "/bg/webp/bg3.webp", + "/bg/webp/bg4.webp", + "/bg/webp/bg5.webp", + "/bg/webp/bg6.webp", + "/bg/webp/bg7.webp", + "/bg/webp/bg8.webp", + "/bg/webp/bg9.webp", + ]; + + const randomBg = bgs[Math.floor(Math.random() * bgs.length)] as string; + + return ( + <> + + XCL + + + +
+ {children} +
+ + ); +} diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index e319df4..a22d51d 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -3,6 +3,7 @@ import { SessionProvider } from "next-auth/react"; import { type AppType } from "next/app"; import { api } from "~/utils/api"; import "~/styles/globals.css"; +import Layout from "~/components/layout"; const MyApp: AppType<{ session: Session | null }> = ({ Component, @@ -10,7 +11,9 @@ const MyApp: AppType<{ session: Session | null }> = ({ }) => { return ( - + + + ); }; diff --git a/src/pages/about.tsx b/src/pages/about.tsx index d12db9a..f3a3821 100644 --- a/src/pages/about.tsx +++ b/src/pages/about.tsx @@ -1,63 +1,30 @@ -import { signIn, signOut, useSession } from "next-auth/react"; -import Head from "next/head"; -import Image from "next/image"; import Link from "next/link"; -import { api } from "~/utils/api"; import { Logo } from "../components/Logo"; -import { LinkButton } from "../components/LinkButton"; import { NavigationBar } from "../components/NavigationBar"; import { PageContentBox } from "~/components/PageContentBox"; export default function About() { - const bgs = [ - "/bg/webp/bg1.webp", - "/bg/webp/bg2.webp", - "/bg/webp/bg3.webp", - "/bg/webp/bg4.webp", - "/bg/webp/bg5.webp", - "/bg/webp/bg6.webp", - "/bg/webp/bg7.webp", - "/bg/webp/bg8.webp", - "/bg/webp/bg9.webp", - ]; - - const randomBg = bgs[Math.floor(Math.random() * bgs.length)] as string; - return ( - <> - - XCL - - - - {/*
*/} -
-
-
- - - -
- -
-
-
- - Here at XCL, we strive to make the SwitchCraft 3 server as - unbearable as possible. While these noobs at SpaceTech are - feeding cookies to parrots, we build space stations not only - for the astronauts, but also for the olympians and war heroes - of our time. - -
-
-
-
+
+
+ + + +
+
-
- +
+
+ + Here at XCL, we strive to make the SwitchCraft 3 server as + unbearable as possible. While these noobs at SpaceTech are feeding + cookies to parrots, we build space stations not only for the + astronauts, but also for the olympians and war heroes of our time. + +
+
+
+ + ); } diff --git a/src/pages/index.tsx b/src/pages/index.tsx index c59ca56..8bf9b46 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,58 +1,26 @@ -import { signIn, signOut, useSession } from "next-auth/react"; -import Head from "next/head"; -import Image from "next/image"; -import Link from "next/link"; -import { api } from "~/utils/api"; import { Logo } from "../components/Logo"; import { LinkButton } from "../components/LinkButton"; import { NavigationBar } from "../components/NavigationBar"; export default function Home() { - const bgs = [ - "/bg/webp/bg1.webp", - "/bg/webp/bg2.webp", - "/bg/webp/bg3.webp", - "/bg/webp/bg4.webp", - "/bg/webp/bg5.webp", - "/bg/webp/bg6.webp", - "/bg/webp/bg7.webp", - "/bg/webp/bg8.webp", - "/bg/webp/bg9.webp", - ]; - - const randomBg = bgs[Math.floor(Math.random() * bgs.length)] as string; - return ( - <> - - XCL - - - - {/*
*/} -
-
-
-
- -
-
- -
- -
-
-
-
+
+
+
+
-
- +
+ +
+ +
+
+
+ + ); } diff --git a/src/pages/team.tsx b/src/pages/team.tsx index 1032cbb..113259a 100644 --- a/src/pages/team.tsx +++ b/src/pages/team.tsx @@ -1,5 +1,3 @@ -import { signIn, signOut, useSession } from "next-auth/react"; -import Head from "next/head"; import Link from "next/link"; import { Logo } from "../components/Logo"; import { NavigationBar } from "~/components/NavigationBar"; @@ -7,50 +5,23 @@ import { PageContentBox } from "~/components/PageContentBox"; import { EmployeeList } from "~/components/EmployeeList"; export default function Team() { - const bgs = [ - "/bg/webp/bg1.webp", - "/bg/webp/bg2.webp", - "/bg/webp/bg3.webp", - "/bg/webp/bg4.webp", - "/bg/webp/bg5.webp", - "/bg/webp/bg6.webp", - "/bg/webp/bg7.webp", - "/bg/webp/bg8.webp", - "/bg/webp/bg9.webp", - ]; - - const randomBg = bgs[Math.floor(Math.random() * bgs.length)] as string; - return ( - <> - - XCL - - - - {/*
*/} -
-
-
- - - -
- -
-
- -
- -
-
-
-
+
+
+ + + +
+
-
- +
+ +
+ +
+
+
+ + ); }