Skip to content

Commit

Permalink
add footer
Browse files Browse the repository at this point in the history
  • Loading branch information
minhd-vu committed Feb 17, 2024
1 parent ea8c379 commit e6281c4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
8 changes: 7 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import type { Metadata } from "next";
import { getServerSession } from "next-auth";
import { Inter } from "next/font/google";
import "./globals.css";
import Navbar from "@/components/Navbar";
import Footer from "@/components/Footer";

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -21,7 +23,11 @@ export default async function RootLayout({
return (
<html lang="en">
<body className={inter.className}>
<SessionProvider session={session}>{children}</SessionProvider>
<SessionProvider session={session}>
<Navbar />
{children}
<Footer />
</SessionProvider>
</body>
</html>
);
Expand Down
2 changes: 0 additions & 2 deletions app/leaderboard/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Navbar from "@/components/Navbar";
import prisma from "@/lib/prisma";

async function getLeaderboardUsers() {
Expand Down Expand Up @@ -45,7 +44,6 @@ export default async function Leaderboard() {

return (
<>
<Navbar />
<div className="relative overflow-x-auto">
<table className="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
<thead className="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
Expand Down
8 changes: 1 addition & 7 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import LoginButton from "@/components/LoginButton";
import Navbar from "@/components/Navbar";
import Party from "@/components/Party";
import { getServerSession } from "next-auth";

export default async function Home() {
const session = await getServerSession();

return (
<>
<Navbar />
{session ? <Party /> : <LoginButton />}
</>
);
return session ? <Party /> : <LoginButton />;
}
16 changes: 16 additions & 0 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default async function Footer() {
return (
<footer className="fixed bottom-0 left-0 z-20 w-full p-4 bg-white border-t border-gray-200 shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800 dark:border-gray-600">
<span className="text-sm text-gray-500 sm:text-center dark:text-gray-400">
© 2024{" "}
<a
href="https://assassinspartygame.vercel.app/"
className="hover:underline"
>
Assassins™
</a>
. All Rights Reserved.
</span>
</footer>
);
}

0 comments on commit e6281c4

Please sign in to comment.