From c6be8f07769c172f27891b98946c11fc27eb47c7 Mon Sep 17 00:00:00 2001 From: Nathaniel Tampus Date: Mon, 20 Feb 2023 17:36:30 +0800 Subject: [PATCH] separate into more components --- client/src/app/Footer.tsx | 27 +++++++++++++ client/src/app/Navbar.tsx | 48 +++++++++++++++++++++++ client/src/app/PublicGames.tsx | 51 ++++++++++++++++++++++++ client/src/app/layout.tsx | 71 ++++------------------------------ client/src/app/page.tsx | 46 +--------------------- 5 files changed, 135 insertions(+), 108 deletions(-) create mode 100644 client/src/app/Footer.tsx create mode 100644 client/src/app/Navbar.tsx create mode 100644 client/src/app/PublicGames.tsx diff --git a/client/src/app/Footer.tsx b/client/src/app/Footer.tsx new file mode 100644 index 0000000..c36bec3 --- /dev/null +++ b/client/src/app/Footer.tsx @@ -0,0 +1,27 @@ +import { IconBrandGithub } from "@tabler/icons-react"; + +export default function Footer() { + return ( + + ); +} diff --git a/client/src/app/Navbar.tsx b/client/src/app/Navbar.tsx new file mode 100644 index 0000000..8e95b0f --- /dev/null +++ b/client/src/app/Navbar.tsx @@ -0,0 +1,48 @@ +import { IconUser, IconSun, IconMoon } from "@tabler/icons-react"; +import Link from "next/link"; + +export default function Navbar() { + return ( +
+
+ + chessu + alpha + +
+
+
+ +
+
+ {/* ^ wrap this in client component too */} + + +
+
+
+ ); +} diff --git a/client/src/app/PublicGames.tsx b/client/src/app/PublicGames.tsx new file mode 100644 index 0000000..581de7e --- /dev/null +++ b/client/src/app/PublicGames.tsx @@ -0,0 +1,51 @@ +import { IconRefresh } from "@tabler/icons-react"; + +export default function PublicGames() { + return ( +
+

+ Public games{" "} +
+ +
+

+ +
+ + + + + + + + + + {/* + + + + */} + + + + + + + {/* invisible last row to set max column widths */} + + + + + + +
HostOpponent
(empty)
sample usernize + +
+
+
+ ); +} diff --git a/client/src/app/layout.tsx b/client/src/app/layout.tsx index 5345dd9..b26b8a8 100644 --- a/client/src/app/layout.tsx +++ b/client/src/app/layout.tsx @@ -1,77 +1,20 @@ import "./globals.css"; -import { IconUser, IconSun, IconMoon, IconBrandGithub } from "@tabler/icons-react"; -import Link from "next/link"; + +import Navbar from "./Navbar"; +import Footer from "./Footer"; export default function RootLayout({ children }: { children: React.ReactNode }) { return ( -
-
- - chessu - alpha - -
-
-
- -
-
- {/* ^ wrap this in client component too */} - - -
-
-
+ +
{children}
- + +