diff --git a/Frontend/bun.lockb b/Frontend/bun.lockb index 8174155..d170874 100644 Binary files a/Frontend/bun.lockb and b/Frontend/bun.lockb differ diff --git a/Frontend/config.json b/Frontend/config.json index 4f5f8d9..d767d2e 100644 --- a/Frontend/config.json +++ b/Frontend/config.json @@ -31,7 +31,7 @@ }, "navbarLinks": { "Player": "/player", - "Server": "/player", + "Server": "/server", "Mojang": "/mojang", "Docs": "/docs" }, diff --git a/Frontend/package.json b/Frontend/package.json index 28865c9..e1a0d2d 100644 --- a/Frontend/package.json +++ b/Frontend/package.json @@ -12,6 +12,8 @@ }, "dependencies": { "@heroicons/react": "^2.1.3", + "@hookform/resolvers": "^3.3.4", + "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-slot": "^1.0.2", "@radix-ui/react-tooltip": "^1.0.7", "class-variance-authority": "^0.7.0", @@ -22,7 +24,8 @@ "next-themes": "^0.3.0", "react": "^18", "react-dom": "^18", - "restfulmc-lib": "^1.0.7", + "react-hook-form": "^7.51.3", + "restfulmc-lib": "^1.0.9", "tailwind-merge": "^2.2.2", "tailwindcss-animate": "^1.0.7" }, diff --git a/Frontend/public/media/players.webp b/Frontend/public/media/players.webp new file mode 100644 index 0000000..765543c Binary files /dev/null and b/Frontend/public/media/players.webp differ diff --git a/Frontend/src/app/(pages)/docs/page.tsx b/Frontend/src/app/(pages)/docs/page.tsx index a5a51a2..9c8bee9 100644 --- a/Frontend/src/app/(pages)/docs/page.tsx +++ b/Frontend/src/app/(pages)/docs/page.tsx @@ -11,13 +11,16 @@ import Link from "next/link"; const DocsPage = (): JSX.Element => (
{/* Creeper */} -
+
{/* Header */}

Documentation

diff --git a/Frontend/src/app/(pages)/player/[[...slug]]/page.tsx b/Frontend/src/app/(pages)/player/[[...slug]]/page.tsx new file mode 100644 index 0000000..e894c02 --- /dev/null +++ b/Frontend/src/app/(pages)/player/[[...slug]]/page.tsx @@ -0,0 +1,72 @@ +import PlayerSearch from "@/components/player/player-search"; +import { minecrafter } from "@/font/fonts"; +import { cn } from "@/lib/utils"; +import { PageProps } from "@/types/page"; +import { Metadata } from "next"; +import Image from "next/image"; +import { CachedPlayer, getPlayer, type RestfulMCAPIError } from "restfulmc-lib"; + +/** + * The page to lookup a player. + * + * @returns the page jsx + */ +const PlayerPage = async ({ params }: PageProps): Promise => { + let error: string | undefined = undefined; // The error to display + let result: CachedPlayer | undefined = undefined; // The player to display + const query: string | undefined = params.slug; // The query to search for + try { + result = params.slug ? await getPlayer(query) : undefined; // Get the player to display + } catch (err) { + error = (err as RestfulMCAPIError).message; // Set the error message + } + + // Render the page + return ( +
+
+ {/* Header */} + Minecraft Players + +
+

+ Player Lookup +

+ + {/* Error */} + {error &&

{error}

} + + {/* Search */} + +
+
+
+ ); +}; + +/** + * Generate metadata for this page. + * + * @param params the route params + * @param searchParams the search params + * @returns the generated metadata + */ +const generateMetadata = async ({ params }: PageProps): Promise => { + console.log("params", params); + return { + title: "bob ross", + }; +}; + +export default PlayerPage; diff --git a/Frontend/src/app/components/landing/featured-content.tsx b/Frontend/src/app/components/landing/featured-content.tsx index e669acc..2e2aba7 100644 --- a/Frontend/src/app/components/landing/featured-content.tsx +++ b/Frontend/src/app/components/landing/featured-content.tsx @@ -32,11 +32,11 @@ const FeaturedItem = ({ href, }: FeaturedItemProps): JSX.Element => (

): JSX.Element => ( +}: React.ButtonHTMLAttributes & + MinecraftButtonProps): JSX.Element => (