diff --git a/app/(content)/(gaming)/games/[gameid]/page.tsx b/app/(content)/(gaming)/games/[gameid]/page.tsx index bfc673bc7b6c401f2f7537ea58ffe447b0442acc..8ae2d7623ae3bb014c185102658d1459ea5e3889 100644 --- a/app/(content)/(gaming)/games/[gameid]/page.tsx +++ b/app/(content)/(gaming)/games/[gameid]/page.tsx @@ -69,7 +69,7 @@ export default async function GameDetail({ params }: { params: { gameid: string <div className="flex flex-col space-y-6 justify-start p-6"> {user && <> - < AddGameDropdown fullUser={fullUser!} gameid={params.gameid} /> + <AddGameDropdown fullUser={fullUser!} gameid={params.gameid} /> <AddGameToFavList userGameList={fullUser?.favGameList!} gameId={params.gameid} /> </> } diff --git a/app/(content)/layout.tsx b/app/(content)/layout.tsx index 12373ef01dbb085190edb28d5fe58b5cdda406f8..e1666f6f99bde71dd3af2907a5972777102feec3 100644 --- a/app/(content)/layout.tsx +++ b/app/(content)/layout.tsx @@ -1,4 +1,5 @@ import { Header } from "@/components/nav-header" +import { MobileNav } from "@/components/nav-mobile" import { Sidebar } from "@/components/nav-sidebar" import { dashboardConfig } from "@/lib/config/dashboard" import { getCurrentUser } from "@/lib/session" @@ -14,12 +15,16 @@ export default async function ContentLayout({ <main className="flex min-h-screen flex-col md:space-y-6 align-middle"> <Header user={user} /> - <div className="md:container grid flex-1 gap-12 grid-cols-5"> + <div className="md:container grid flex-1 md:gap-12 grid-cols-5"> <aside className="self-start sticky top-[89px] hidden md:col-span-1 md:block"> <Sidebar items={dashboardConfig.sidebarNav} user={user} /> </aside> - <div className="flex flex-1 flex-col w-full h-full col-span-5 md:col-span-4 md:pb-6"> + <div className="flex flex-1 flex-col w-full h-full col-span-5 md:col-span-4 mb-16 md:pb-6"> {children} + + <div className="md:hidden fixed bottom-0 left-0 z-50 w-full h-16 bg-background border-t"> + <MobileNav items={dashboardConfig.sidebarNav} user={user} /> + </div> </div> </div> </main> diff --git a/app/layout.tsx b/app/layout.tsx index 88906569c05cdfc4ff819375b2c6936a4eefe159..2e2978a8a32bc43a913c0493afef304099bc656c 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -53,6 +53,13 @@ export const metadata = { { media: "(prefers-color-scheme: light)", color: "white" }, { media: "(prefers-color-scheme: dark)", color: "black" }, ], + metadataBase: new URL(siteConfig.url), + alternates: { + canonical: '/', + languages: { + 'en-US': '/en-US', + }, + }, openGraph: { type: "website", locale: "en_US", diff --git a/app/opengraph-image.png b/app/opengraph-image.png new file mode 100644 index 0000000000000000000000000000000000000000..359b4a94874e8d6fd5627fd80c064ae93e1ebc13 Binary files /dev/null and b/app/opengraph-image.png differ diff --git a/app/twitter-image.png b/app/twitter-image.png new file mode 100644 index 0000000000000000000000000000000000000000..359b4a94874e8d6fd5627fd80c064ae93e1ebc13 Binary files /dev/null and b/app/twitter-image.png differ diff --git a/components/add-game-dropdown.tsx b/components/add-game-dropdown.tsx index 417b5823cbecfd4f539d053bc493ee1f014dc965..ebb85fba9c004bbb2ef5e1037caa7d59fe977758 100644 --- a/components/add-game-dropdown.tsx +++ b/components/add-game-dropdown.tsx @@ -13,7 +13,7 @@ export default function AddGameDropdown(props: { gameid: string, fullUser: User <SelectValue placeholder="Status" /> </SelectTrigger> <SelectContent> - <SelectGroup> + <SelectGroup className="space-y-3 w-full"> <AddGameToPlanList user={props.fullUser!} gameId={props.gameid} /> <AddGameToFinishedList user={props.fullUser!} gameId={props.gameid} /> <AddGameToPlayingList user={props.fullUser!} gameId={props.gameid} /> diff --git a/components/add-game-to-finished-list.tsx b/components/add-game-to-finished-list.tsx index f3dd00f009aef779db5a2808cfaf80ebc72abea2..09e52fa3685a2cb673ee8fe5e934a761e4a0e5ef 100644 --- a/components/add-game-to-finished-list.tsx +++ b/components/add-game-to-finished-list.tsx @@ -65,12 +65,12 @@ export default function AddGameToFinishedList(props: { gameId: string, user: Use } - let button = <div></div> + let button = <></> try { if (!props.user.finishedGameList.includes(parseFloat(props.gameId))) { button = ( <form onSubmit={addGame}> - <Button type="submit" size="lg" variant="ghost"> + <Button type="submit" size="lg" variant="ghost" className="w-full justify-start"> Set as Finished </Button> </form> @@ -78,7 +78,7 @@ export default function AddGameToFinishedList(props: { gameId: string, user: Use } else { button = ( <form onSubmit={removeGame}> - <Button type="submit" size="lg" variant="ghost"> + <Button type="submit" size="lg" variant="ghost" className="w-full justify-start text-destructive"> Unset Finished </Button> </form> diff --git a/components/add-game-to-plan-list.tsx b/components/add-game-to-plan-list.tsx index d1be6bcef65d96aad71e65b73021bdffb129c12a..0dc40a878cebe32f754b35099382a8e66de55012 100644 --- a/components/add-game-to-plan-list.tsx +++ b/components/add-game-to-plan-list.tsx @@ -65,12 +65,12 @@ export default function AddGameToPlanList(props: { gameId: string, user: User }) } - let button = <div></div> + let button = <></> try { if (!props.user.planningGameList.includes(parseFloat(props.gameId))) { button = ( <form onSubmit={addGame}> - <Button type="submit" size="lg" variant={"ghost"}> + <Button type="submit" size="lg" variant={"ghost"} className="w-full justify-start"> Set as Planning </Button> </form> @@ -78,7 +78,7 @@ export default function AddGameToPlanList(props: { gameId: string, user: User }) } else { button = ( <form onSubmit={removeGame}> - <Button type="submit" size="lg" variant={"ghost"}> + <Button type="submit" size="lg" variant={"ghost"} className="w-full justify-start text-destructive"> Unset Planning </Button> </form> diff --git a/components/add-game-to-playing-list.tsx b/components/add-game-to-playing-list.tsx index 365f4707db4f74bbfcb24e62bb7f8842f7ffd8f3..8f15252f2877a68fc80777ef0c30d3ca41b08e1f 100644 --- a/components/add-game-to-playing-list.tsx +++ b/components/add-game-to-playing-list.tsx @@ -65,12 +65,12 @@ export default function AddGameToPlayingList(props: { gameId: string, user: User } - let button = <div></div> + let button = <></> try { if (!props.user.playingGameList.includes(parseFloat(props.gameId))) { button = ( <form onSubmit={addGame}> - <Button type="submit" size="lg" variant={"ghost"}> + <Button type="submit" size="lg" variant={"ghost"} className="w-full justify-start"> Set as Playing </Button> </form> @@ -78,7 +78,7 @@ export default function AddGameToPlayingList(props: { gameId: string, user: User } else { button = ( <form onSubmit={removeGame}> - <Button type="submit" size="lg" variant={"ghost"}> + <Button type="submit" size="lg" variant={"ghost"} className="w-full justify-start text-destructive"> Unset Playing </Button> </form> diff --git a/components/addGameToFavList.tsx b/components/addGameToFavList.tsx index 9106e429f2c4f3c302e506409d1d775ed0b0ae82..6ad1725c265a25dedba575813d7b0a0bc4863337 100644 --- a/components/addGameToFavList.tsx +++ b/components/addGameToFavList.tsx @@ -52,7 +52,7 @@ export default function AddGameToFavList(props: { userGameList: Number[], gameId if (!props.userGameList.includes(parseFloat(props.gameId))) { button = ( <form onSubmit={addGame}> - <Button type="submit" size="lg"> + <Button type="submit" size="lg" className="w-full"> Add To Favorites </Button> </form> @@ -60,7 +60,7 @@ export default function AddGameToFavList(props: { userGameList: Number[], gameId } else { button = ( <form onSubmit={removeGame}> - <Button type="submit" size="lg" variant={"secondary"}> + <Button type="submit" size="lg" variant="secondary" className="w-full"> Remove From Favorites </Button> </form> diff --git a/components/nav-mobile.tsx b/components/nav-mobile.tsx new file mode 100644 index 0000000000000000000000000000000000000000..ae9b254cfc3b6ad53133633c6281f375aab4ea71 --- /dev/null +++ b/components/nav-mobile.tsx @@ -0,0 +1,39 @@ +"use client" + +import { Icons } from "@/components/icons" +import { cn } from "@/lib/utils" +import { SidebarNavItem } from "@/types" +import { User } from "next-auth" +import Link from "next/link" +import { usePathname } from "next/navigation" +import { Button } from "./ui/button" + +export const MobileNav = ({ items, user }: { items: SidebarNavItem[], user: User | undefined }) => { + const path = usePathname() + + if (!items?.length) { + return null + } + + const visibleItems = user ? items : items.slice(0, 2) + + return ( + <nav className={`grid h-full max-w-lg grid-cols-${items.length} justify-between mx-auto`}> + {visibleItems.map((item, index) => { + const Icon = Icons[item.icon || "arrowRight"] + if (item.title === "My Profile") { + item.href = `/${user?.username}` + } + return ( + item.href && ( + <Link key={index} href={item.disabled ? "/" : item.href} className="inline-flex items-center justify-center"> + <Button variant={`${path.startsWith(item.href) ? "secondary" : "ghost"}`} size="logo"> + <Icon /> + </Button> + </Link> + ) + ) + })} + </nav> + ) +} \ No newline at end of file diff --git a/components/user-nav.tsx b/components/user-nav.tsx index 808d4f0c4a0861eca603e243f8619de56bf44b0d..6883170854d2ef63424c56978f6ce814b9e037bf 100644 --- a/components/user-nav.tsx +++ b/components/user-nav.tsx @@ -27,7 +27,7 @@ export function UserAccountDropdown({ user }: UserAccountNavProps) { className="h-8 w-8 shadow-none focus:shadow-none" /> </DropdownMenuTrigger> - <DropdownMenuContent align="end"> + <DropdownMenuContent align="end" className="mt-1"> <div className="flex items-center justify-start gap-2 p-2"> <div className="flex flex-col space-y-1 leading-none"> {user.name && <p className="font-medium">{user.name}</p>} diff --git a/lib/config/site.ts b/lib/config/site.ts index 955f866a2576209b8ce88f0f155d8d5b9074eb5d..e753cc398d0a72a69f9c3a3020ee6085e3b481af 100644 --- a/lib/config/site.ts +++ b/lib/config/site.ts @@ -5,5 +5,5 @@ export const siteConfig: SiteConfig = { description: "Your social media for game tracking needs, so you can finally get an overview of your games. Built using the new router, server components and everything new in Next.js 13.", url: "https://gameunity.vercel.app/", - ogImage: "", + ogImage: "https://gameunity.vercel.app/og.png", } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 845a1861a179f2a7dfe9feb821513bdd534ce602..8ec129f2d7b036817b9259a544b8df23364f045d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "project_ss23_gameunity", - "version": "0.2.0", + "version": "0.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "project_ss23_gameunity", - "version": "0.2.0", + "version": "0.3.0", "hasInstallScript": true, "dependencies": { "@auth/prisma-adapter": "^1.0.1", diff --git a/public/apple-icon.png b/public/apple-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d13f3edac519706cd120bd5a54026315c2ddf50b Binary files /dev/null and b/public/apple-icon.png differ diff --git a/public/favicon-16x16.png b/public/favicon-16x16.png new file mode 100644 index 0000000000000000000000000000000000000000..1699bc8bd9c4e7de14c128ac95f4e7e0ca888b7c Binary files /dev/null and b/public/favicon-16x16.png differ diff --git a/public/favicon-32x32.png b/public/favicon-32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..7208458d620655fa241c4c4302b2ff65d8c6e1a4 Binary files /dev/null and b/public/favicon-32x32.png differ diff --git a/public/favicon.ico b/public/favicon.ico index 718d6fea4835ec2d246af9800eddb7ffb276240c..b98323ee5ddfc3918343d93c8670e9ef93133da6 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ