From c054a31008fb3f09c15fd6430815000773c2e4f9 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 15 Apr 2024 12:12:24 +0100 Subject: [PATCH] cleanup and add mobile support --- src/app/layout.tsx | 8 ++---- src/app/page.tsx | 2 +- src/common/fonts.ts | 7 +++++ src/components/navbar.tsx | 1 - src/components/player-search.tsx | 47 ++++++++++++++++++-------------- src/components/server-search.tsx | 30 +++++++++++--------- src/components/ui/card.tsx | 2 +- 7 files changed, 55 insertions(+), 42 deletions(-) create mode 100644 src/common/fonts.ts diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 4be3d6f..35c7bea 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,15 +1,13 @@ +import { Fonts } from "@/common/fonts"; import Container from "@/components/container"; import ThemeProvider from "@/components/theme-provider"; import { Metadata, Viewport } from "next"; import { ToastContainer } from "react-toastify"; -import Config from "../../config.json"; - -import { Inter } from "next/font/google"; import "react-toastify/dist/ReactToastify.css"; import "./globals.css"; -const inter = Inter({ subsets: ["latin"] }); +import Config from "../../config.json"; export const viewport: Viewport = { themeColor: "#3498DB", @@ -39,7 +37,7 @@ export default function RootLayout({ }>) { return ( <> - + diff --git a/src/app/page.tsx b/src/app/page.tsx index ae2e159..93d72c5 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -13,7 +13,7 @@ const buttons: Button[] = [ export default function Home() { return (
-

Minecraft Utilities

+

Minecraft Utilities

Minecraft Utilities offers you many endpoints to get information about a minecraft server or a player.

diff --git a/src/common/fonts.ts b/src/common/fonts.ts new file mode 100644 index 0000000..a6aa953 --- /dev/null +++ b/src/common/fonts.ts @@ -0,0 +1,7 @@ +import { Inter } from "next/font/google"; + +const inter = Inter({ subsets: ["latin"] }); + +export const Fonts = { + inter: inter, +}; diff --git a/src/components/navbar.tsx b/src/components/navbar.tsx index 7caea27..aab6c5a 100644 --- a/src/components/navbar.tsx +++ b/src/components/navbar.tsx @@ -7,7 +7,6 @@ type Page = { }; const pages: Page[] = [ - { title: "Home", url: "/" }, { title: "Player", url: "/player" }, { title: "Server", url: "/server" }, ]; diff --git a/src/components/player-search.tsx b/src/components/player-search.tsx index db660a2..d9abb30 100644 --- a/src/components/player-search.tsx +++ b/src/components/player-search.tsx @@ -1,6 +1,7 @@ "use client"; import { getPlayer } from "mcutils-library"; +import { Player } from "mcutils-library/dist/types/player/player"; import Image from "next/image"; import Link from "next/link"; import { useState } from "react"; @@ -13,7 +14,7 @@ const defaultPlayerId = "Notch"; export default function PlayerSearch() { const [playerId, setPlayerId] = useState(defaultPlayerId); - const [player, setPlayer] = useState(null); + const [player, setPlayer] = useState(null); const handleLookup = async () => { if (playerId === null || playerId.length <= 0) { @@ -52,26 +53,30 @@ export default function PlayerSearch() { {player && ( - The player's Head -

-

- Unique ID: {player.uniqueId} -

-

- Name: {player.username} -

-
-

Skin Parts

-
- {Object.keys(player.skin.parts).map((part: any, index: number) => { - return ( -

- - {part} - -

- ); - })} +
+
+ The player's Head +
+
+

+ UUID: {player.uniqueId} +

+

+ Name: {player.username} +

+
+

Skin Parts

+
+ {Object.keys(player.skin.parts).map((part: any, index: number) => { + return ( +

+ + {part} + +

+ ); + })} +
diff --git a/src/components/server-search.tsx b/src/components/server-search.tsx index 0ba8733..ee1615d 100644 --- a/src/components/server-search.tsx +++ b/src/components/server-search.tsx @@ -53,22 +53,26 @@ export default function ServerSearch() { {server && ( -
- The server's Icon +
+
+
+ The server's Favicon +
-
- {server.motd.html.map((line, index) => { - return
; - })} +
+ {server.motd.html.map((line, index) => { + return
; + })} +
-
-
-
- Host: {server.hostname} -
-
- Players: {server.players.online}/{server.players.max} +
+
+ Host: {server.hostname} +
+
+ Players: {server.players.online}/{server.players.max} +
diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx index 120fd1c..545d935 100644 --- a/src/components/ui/card.tsx +++ b/src/components/ui/card.tsx @@ -3,5 +3,5 @@ export function Card({ }: Readonly<{ children: React.ReactNode; }>) { - return
{children}
; + return
{children}
; }