From 10b12a60dae9193b933b2a697a35881be7d26b3e Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Tue, 16 Apr 2024 10:48:32 -0400 Subject: [PATCH] Move featured items to the config, and make it more responsive --- Frontend/config.json | 16 +++++++- Frontend/src/app/(pages)/docs/page.tsx | 2 +- .../components/landing/featured-content.tsx | 38 +++++++++++-------- Frontend/src/app/not-found.tsx | 6 +-- Frontend/src/app/types/config.d.ts | 31 +++++++++++++++ 5 files changed, 72 insertions(+), 21 deletions(-) diff --git a/Frontend/config.json b/Frontend/config.json index 7f0bf66..4f5f8d9 100644 --- a/Frontend/config.json +++ b/Frontend/config.json @@ -34,5 +34,19 @@ "Server": "/player", "Mojang": "/mojang", "Docs": "/docs" - } + }, + "featuredItems": [ + { + "name": "Player Lookup", + "description": "Wanna find a player? You can locate them here by their username or UUID.", + "image": "/media/featured/server.png", + "href": "/player" + }, + { + "name": "Server Lookup", + "description": "Fugiat culpa est consequat nostrud exercitation ut id ex in.", + "image": "/media/featured/server.png", + "href": "/player" + } + ] } diff --git a/Frontend/src/app/(pages)/docs/page.tsx b/Frontend/src/app/(pages)/docs/page.tsx index bb638bd..a5a51a2 100644 --- a/Frontend/src/app/(pages)/docs/page.tsx +++ b/Frontend/src/app/(pages)/docs/page.tsx @@ -1,7 +1,7 @@ import Creeper from "@/components/creeper"; import { minecrafter } from "@/font/fonts"; +import { cn } from "@/lib/utils"; import Link from "next/link"; -import { cn } from "../../lib/utils"; /** * The documentation page. diff --git a/Frontend/src/app/components/landing/featured-content.tsx b/Frontend/src/app/components/landing/featured-content.tsx index 4958536..e669acc 100644 --- a/Frontend/src/app/components/landing/featured-content.tsx +++ b/Frontend/src/app/components/landing/featured-content.tsx @@ -1,35 +1,41 @@ +import config from "@/config"; import { minecrafter } from "@/font/fonts"; import { cn } from "@/lib/utils"; +import { FeaturedItemProps } from "@/types/config"; import Link from "next/link"; +/** + * The featured content component. + * + * @returns the featured content jsx + */ const FeaturedContent = (): JSX.Element => (
-
- +
+ {config.featuredItems.map((item, index) => ( + + ))}
); +/** + * A featured item component. + * + * @param props the item props + * @returns the item jsx + */ const FeaturedItem = ({ name, description, image, href, -}: { - name: string; - description: string; - image: string; - href: string; -}): JSX.Element => ( +}: FeaturedItemProps): JSX.Element => (