diff --git a/docs/advanced/command-bar.mdx b/docs/advanced/command-bar.mdx
index 758b07a..21406ab 100644
--- a/docs/advanced/command-bar.mdx
+++ b/docs/advanced/command-bar.mdx
@@ -11,12 +11,12 @@ The command-bar has many mods and is a great tool for power-users to use as its
## Triggering the command-bar
-There are two ways to trigger the command bar, using `Ctrl+K` and `Ctrl+Shift+K`. Both put you in a command-bar, however when using `Ctrl+K`, you go into a general page with other settings.
-Using `Ctrl+Shift+K` opens a server viewer, and this may be faster then going through the general page.
+There are two ways to trigger the command bar, using `Ctrl+K` and Ctrl + Shift + K. Both put you in a command-bar, however when using `Ctrl+K`, you go into a general page with other settings.
+Using Ctrl + Shift + K opens a server viewer, and this may be faster then going through the general page.
-## Functions using `Ctrl+K`
+## Functions using Ctrl+K
-- **Servers** opens a server list, same as `Ctrl+Shift+K`
+- **Servers** opens a server list, same as Ctrl + Shift + K
- **Sort Servers** allows you to go into a sorted server list quickly
- **Links** shows links useful for MHSF
- **Pick Random Server** picks a random server and shows the user what that server is, is similar to the one on [the server list](/)
diff --git a/docs/guides/owning-a-server.mdx b/docs/guides/owning-a-server.mdx
index 295ef4c..a60eae5 100644
--- a/docs/guides/owning-a-server.mdx
+++ b/docs/guides/owning-a-server.mdx
@@ -5,11 +5,11 @@ folder: "Guides"
# Owning a server
-Owning a server is quite simple and allows you to [customize your server](/docs/guides/customization) your server and make it stand out from other servers. Before owning your server, make sure you agree to the [ECA](Docs:legal/external-content-agreement).
+Owning a server is quite simple and allows you to [customize your server](/docs/guides/customization) and make it stand out from other servers. Before owning your server, make sure you agree to the [ECA](Docs:legal/external-content-agreement).
## Linking
-Find the server you would like to own (either by looking for it, or using the keyboard shortcut `Ctrl`+`Shift`+`K` and searching for it), and make sure your account has [already been linked with your Minecraft account](Docs:guides/linking). Go to the server, and hit the Customization tab. If the owner of the server, and the user your linked to match, you will gain access to the server.
+Find the server you would like to own (either by looking for it, or using the keyboard shortcut Ctrl+Shift+K and searching for it), and make sure your account has [already been linked with your Minecraft account](Docs:guides/linking). Go to the server, and hit the Customization tab. If the owner of the server, and the user your linked to match, you will gain access to the server.
If they match, you should see a button named Click to own. Press that button, and you should automagically own the server. Congratulations!
## I can't link my server, because my server doesn't have a author
diff --git a/package.json b/package.json
index e7558ef..58be176 100644
--- a/package.json
+++ b/package.json
@@ -19,6 +19,8 @@
"@emotion/is-prop-valid": "^1.3.0",
"@linear/sdk": "^31.0.0",
"@monaco-editor/react": "^4.6.0",
+ "@radix-ui/react-avatar": "^1.1.1",
+ "@radix-ui/react-collapsible": "^1.1.1",
"@radix-ui/react-hover-card": "^1.1.1",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-menubar": "^1.1.1",
@@ -35,7 +37,7 @@
"inngest": "^3.21.2",
"input-otp": "^1.2.4",
"json-beautify": "^1.1.1",
- "lucide-react": "^0.416.0",
+ "lucide-react": "^0.454.0",
"minimessage-2-html": "1.6.0",
"mongodb": "^6.8.0",
"next": "14.2.10",
@@ -63,17 +65,17 @@
"@hookform/resolvers": "^3.9.0",
"@radix-ui/react-checkbox": "^1.1.1",
"@radix-ui/react-context-menu": "^2.1.5",
- "@radix-ui/react-dialog": "^1.1.1",
- "@radix-ui/react-dropdown-menu": "^2.1.1",
+ "@radix-ui/react-dialog": "^1.1.2",
+ "@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-navigation-menu": "^1.1.4",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-radio-group": "^1.2.0",
"@radix-ui/react-scroll-area": "^1.1.0",
- "@radix-ui/react-separator": "^1.0.3",
+ "@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.0",
- "@radix-ui/react-tooltip": "^1.0.7",
+ "@radix-ui/react-tooltip": "^1.1.3",
"@tailwindcss/typography": "^0.5.13",
"@types/canvas-confetti": "^1.6.4",
"@types/node": "^20",
diff --git a/src/app/(docs)/docs/[[...slug]]/page.tsx b/src/app/(docs)/docs/[[...slug]]/page.tsx
new file mode 100644
index 0000000..1b563f2
--- /dev/null
+++ b/src/app/(docs)/docs/[[...slug]]/page.tsx
@@ -0,0 +1,129 @@
+/*
+ * MHSF, Minehut Server List
+ * All external content is rather licensed under the ECA Agreement
+ * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
+ *
+ * All code under MHSF is licensed under the MIT License
+ * by open source contributors
+ *
+ * Copyright (c) 2024 dvelo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+import TableOfContent from "@/components/docs/TOC";
+import { ALegacy } from "@/components/misc/Link";
+import { MDXElements } from "@/components/misc/MDXElements";
+import { ScrollArea } from "@/components/ui/scroll-area";
+import { Separator } from "@/components/ui/separator";
+import { allDocs } from "contentlayer/generated";
+import { useMDXComponent } from "next-contentlayer/hooks";
+import NextLink from "next/link";
+import { notFound } from "next/navigation";
+
+export const generateStaticParams = async () =>
+ allDocs.map((post) => ({ slug: [post._raw.flattenedPath] }));
+
+export const generateMetadata = ({
+ params,
+}: {
+ params: { slug: string[] };
+}) => {
+ const post = allDocs.find(
+ (post) => post._raw.flattenedPath === params.slug.join("/"),
+ );
+ if (!post) notFound();
+ return { title: post.title + " | MHSF Docs", themeColor: "#000000" };
+};
+
+const PostLayout = ({ params }: { params: { slug: string[] } }) => {
+ const doc = allDocs.find(
+ (post) => post._raw.flattenedPath === params.slug.join("/"),
+ );
+
+ if (!doc) notFound();
+ console.log(doc);
+ const MDXContent = useMDXComponent(doc.body.code);
+
+ return (
+
+
+
+ );
}
diff --git a/src/app/server/[server]/customize/page.tsx b/src/app/(main)/server/[server]/customize/page.tsx
similarity index 100%
rename from src/app/server/[server]/customize/page.tsx
rename to src/app/(main)/server/[server]/customize/page.tsx
diff --git a/src/app/(main)/server/[server]/page.tsx b/src/app/(main)/server/[server]/page.tsx
new file mode 100644
index 0000000..dd16f18
--- /dev/null
+++ b/src/app/(main)/server/[server]/page.tsx
@@ -0,0 +1,155 @@
+/*
+ * MHSF, Minehut Server List
+ * All external content is rather licensed under the ECA Agreement
+ * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
+ *
+ * All code under MHSF is licensed under the MIT License
+ * by open source contributors
+ *
+ * Copyright (c) 2024 dvelo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+import AfterServerView from "@/components/AfterServerView";
+import Banner from "@/components/Banner";
+import ColorProvider from "@/components/ColorProvider";
+import ServerView from "@/components/ServerView";
+import TabServer from "@/components/misc/TabServer";
+import { Button } from "@/components/ui/button";
+import { Separator } from "@/components/ui/separator";
+import { CornerDownLeft } from "lucide-react";
+import type { Metadata, ResolvingMetadata } from "next";
+import Link from "next/link";
+
+type Props = {
+ params: { server: string };
+};
+
+export async function generateMetadata(
+ { params }: Props,
+ parent: ResolvingMetadata,
+): Promise {
+ // read route params
+ const { server } = params;
+ const json = await (
+ await fetch("https://api.minehut.com/server/" + server + "?byName=true")
+ ).json();
+
+ return {
+ themeColor: "#000000",
+ title:
+ json.server == null
+ ? "Server doesn't exist | MHSF"
+ : json.server.name +
+ ", " +
+ (json.server.online
+ ? json.server.playerCount +
+ (json.server.maxPlayers != 10
+ ? "/" + json.server.maxPlayers
+ : "") +
+ " online"
+ : "Offline") +
+ " | MHSF",
+ description:
+ json.server == null
+ ? `The server ${server} doesn't exist.`
+ : `View ${server} on Minehut Server Finder!`,
+ authors: json.server == null ? undefined : { name: json.server.owner },
+ applicationName: "MHSF (Minehut Server Finder)",
+ icons:
+ json.server == null
+ ? undefined
+ : "https://minehut-server-icons-live.s3.us-west-2.amazonaws.com/" +
+ (json.server.icon == undefined ? "OAK_SIGN" : json.server.icon) +
+ ".png",
+ twitter: {
+ title:
+ json.server == null
+ ? "Server doesn't exist | MHSF"
+ : json.server.name +
+ ", " +
+ (json.server.online
+ ? json.server.playerCount +
+ (json.server.maxPlayers != 10
+ ? "/" + json.server.maxPlayers
+ : "") +
+ " online"
+ : "Offline") +
+ " | MHSF",
+ description:
+ json.server == null
+ ? `The server ${server} doesn't exist.`
+ : `View ${server} on Minehut Server Finder!`,
+ images: [
+ {
+ url:
+ "https://minehut-server-icons-live.s3.us-west-2.amazonaws.com/" +
+ json.server.icon +
+ ".png",
+ },
+ {
+ url: "/public/imgs/icon-cf.png",
+ },
+ ],
+ },
+ openGraph: {
+ type: "profile",
+ siteName: "MHSF (Minehut Server Finder)",
+
+ images: [
+ {
+ url:
+ "https://minehut-server-icons-live.s3.us-west-2.amazonaws.com/" +
+ json.server.icon +
+ ".png",
+ },
+ {
+ url: "/public/imgs/icon-cf.png",
+ },
+ ],
+ },
+ };
+}
+
+export default function ServerPage({ params }: { params: { server: string } }) {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/src/app/(main)/server/[server]/statistics/page.tsx b/src/app/(main)/server/[server]/statistics/page.tsx
new file mode 100644
index 0000000..c242b98
--- /dev/null
+++ b/src/app/(main)/server/[server]/statistics/page.tsx
@@ -0,0 +1,116 @@
+/*
+ * MHSF, Minehut Server List
+ * All external content is rather licensed under the ECA Agreement
+ * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
+ *
+ * All code under MHSF is licensed under the MIT License
+ * by open source contributors
+ *
+ * Copyright (c) 2024 dvelo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+import Banner from "@/components/Banner";
+import ColorProvider from "@/components/ColorProvider";
+import { NewChart } from "@/components/NewChart";
+import ServerView from "@/components/ServerView";
+import TabServer from "@/components/misc/TabServer";
+import { Separator } from "@/components/ui/separator";
+import type { Metadata, ResolvingMetadata } from "next";
+
+type Props = {
+ params: { server: string };
+};
+
+export async function generateMetadata(
+ { params }: Props,
+ parent: ResolvingMetadata,
+): Promise {
+ // read route params
+ const { server } = params;
+ const json = await (
+ await fetch("https://api.minehut.com/server/" + server + "?byName=true")
+ ).json();
+
+ return {
+ title:
+ json.server == null
+ ? "Server doesn't exist | MHSF"
+ : json.server.name +
+ ", " +
+ (json.server.online
+ ? json.server.playerCount +
+ (json.server.maxPlayers != 10
+ ? "/" + json.server.maxPlayers
+ : "") +
+ " online"
+ : "Offline") +
+ " | MHSF",
+ description:
+ json.server == null
+ ? `The server ${server} doesn't exist.`
+ : `View ${server} on Minehut Server Finder!`,
+ authors: json.server == null ? undefined : { name: json.server.owner },
+ applicationName: "MHSF (Minehut Server Finder)",
+ icons:
+ json.server == null
+ ? undefined
+ : "https://mcapi.marveldc.me/item/" +
+ (json.server.icon == undefined ? "OAK_SIGN" : json.server.icon) +
+ "?width=64&height=64",
+ openGraph: {
+ type: "profile",
+ siteName: "MHSF (Minehut Server Finder)",
+ images: [
+ {
+ url:
+ "https://mcapi.marveldc.me/item/" +
+ json.server.icon +
+ "?width=64&height=64",
+ },
+ {
+ url: "/favicon.ico",
+ },
+ ],
+ },
+ };
+}
+
+export default function ServerPage({ params }: { params: { server: string } }) {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/src/app/docs/[[...slug]]/page.tsx b/src/app/docs/[[...slug]]/page.tsx
deleted file mode 100644
index e95f00f..0000000
--- a/src/app/docs/[[...slug]]/page.tsx
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import TableOfContent from "@/components/docs/TOC";
-import { ScrollArea } from "@/components/ui/scroll-area";
-import { allDocs } from "contentlayer/generated";
-import { useMDXComponent } from "next-contentlayer/hooks";
-import NextLink from "next/link";
-import { notFound } from "next/navigation";
-import { Separator } from "@/components/ui/separator";
-import { ALegacy } from "@/components/misc/Link";
-import { MDXElements } from "@/components/misc/MDXElements";
-
-export const generateStaticParams = async () =>
- allDocs.map((post) => ({ slug: [post._raw.flattenedPath] }));
-
-export const generateMetadata = ({
- params,
-}: {
- params: { slug: string[] };
-}) => {
- const post = allDocs.find(
- (post) => post._raw.flattenedPath === params.slug.join("/")
- );
- if (!post) notFound();
- return { title: post.title + " | MHSF Docs", themeColor: "#000000" };
-};
-
-const PostLayout = ({ params }: { params: { slug: string[] } }) => {
- const doc = allDocs.find(
- (post) => post._raw.flattenedPath === params.slug.join("/")
- );
-
- if (!doc) notFound();
- console.log(doc);
- const MDXContent = useMDXComponent(doc.body.code);
-
- return (
-
-
- )}
-
- );
-};
-export default PostLayout;
diff --git a/src/app/globals.css b/src/app/globals.css
index e984190..c023a5d 100644
--- a/src/app/globals.css
+++ b/src/app/globals.css
@@ -73,6 +73,15 @@
--color-one: #37ecba;
--color-two: #72afd3;
--color-three: #ff2e63;
+ --sidebar-background: 0 0% 98%;
+ --sidebar-foreground: 240 5.3% 26.1%;
+ --sidebar-primary: 240 5.9% 10%;
+ --sidebar-primary-foreground: 0 0% 98%;
+ --sidebar-mhsf: 240 1% 92%;
+ --sidebar-accent: 240 4.8% 95.9%;
+ --sidebar-accent-foreground: 240 5.9% 10%;
+ --sidebar-border: 220 13% 91%;
+ --sidebar-ring: 217.2 91.2% 59.8%;
}
.dark {
@@ -112,6 +121,15 @@
--chart-3: 216 92% 60%;
--chart-4: 210 98% 78%;
--chart-5: 212 97% 87%;
+ --sidebar-background: 240 5.9% 10%;
+ --sidebar-foreground: 240 4.8% 95.9%;
+ --sidebar-primary: 224.3 76.3% 48%;
+ --sidebar-primary-foreground: 0 0% 100%;
+ --sidebar-mhsf: 240 0% 13%;
+ --sidebar-accent: 240 3.7% 15.9%;
+ --sidebar-accent-foreground: 240 4.8% 95.9%;
+ --sidebar-border: 240 3.7% 15.9%;
+ --sidebar-ring: 217.2 91.2% 59.8%;
}
}
@@ -123,11 +141,11 @@
@apply bg-background text-foreground;
}
}
-@layer base {
- a {
- @apply underline text-blue-400;
- }
-}
+/*@layer base {*/
+/* a {*/
+/* @apply underline text-blue-400;*/
+/* }*/
+/*}*/
.backdrop-blur {
-webkit-backdrop-filter: blur(8px) !important;
diff --git a/src/app/server/[server]/page.tsx b/src/app/server/[server]/page.tsx
deleted file mode 100644
index f639e40..0000000
--- a/src/app/server/[server]/page.tsx
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import ServerView from "@/components/ServerView";
-import type { Metadata, ResolvingMetadata } from "next";
-import TabServer from "@/components/misc/TabServer";
-import ColorProvider from "@/components/ColorProvider";
-import AfterServerView from "@/components/AfterServerView";
-import Banner from "@/components/Banner";
-import { Button } from "@/components/ui/button";
-import { CornerDownLeft } from "lucide-react";
-import Link from "next/link";
-
-type Props = {
- params: { server: string };
-};
-
-export async function generateMetadata(
- { params }: Props,
- parent: ResolvingMetadata
-): Promise {
- // read route params
- const { server } = params;
- const json = await (
- await fetch("https://api.minehut.com/server/" + server + "?byName=true")
- ).json();
-
- return {
- themeColor: "#000000",
- title:
- json.server == null
- ? "Server doesn't exist | MHSF"
- : json.server.name +
- ", " +
- (json.server.online
- ? json.server.playerCount +
- (json.server.maxPlayers != 10
- ? "/" + json.server.maxPlayers
- : "") +
- " online"
- : "Offline") +
- " | MHSF",
- description:
- json.server == null
- ? `The server ${server} doesn't exist.`
- : `View ${server} on Minehut Server Finder!`,
- authors: json.server == null ? undefined : { name: json.server.owner },
- applicationName: "MHSF (Minehut Server Finder)",
- icons:
- json.server == null
- ? undefined
- : "https://minehut-server-icons-live.s3.us-west-2.amazonaws.com/" +
- (json.server.icon == undefined ? "OAK_SIGN" : json.server.icon) +
- ".png",
- twitter: {
- title:
- json.server == null
- ? "Server doesn't exist | MHSF"
- : json.server.name +
- ", " +
- (json.server.online
- ? json.server.playerCount +
- (json.server.maxPlayers != 10
- ? "/" + json.server.maxPlayers
- : "") +
- " online"
- : "Offline") +
- " | MHSF",
- description:
- json.server == null
- ? `The server ${server} doesn't exist.`
- : `View ${server} on Minehut Server Finder!`,
- images: [
- {
- url:
- "https://minehut-server-icons-live.s3.us-west-2.amazonaws.com/" +
- json.server.icon +
- ".png",
- },
- {
- url: "/public/imgs/icon-cf.png",
- },
- ],
- },
- openGraph: {
- type: "profile",
- siteName: "MHSF (Minehut Server Finder)",
-
- images: [
- {
- url:
- "https://minehut-server-icons-live.s3.us-west-2.amazonaws.com/" +
- json.server.icon +
- ".png",
- },
- {
- url: "/public/imgs/icon-cf.png",
- },
- ],
- },
- };
-}
-
-export default function ServerPage({ params }: { params: { server: string } }) {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}
diff --git a/src/app/server/[server]/statistics/page.tsx b/src/app/server/[server]/statistics/page.tsx
deleted file mode 100644
index 7855e66..0000000
--- a/src/app/server/[server]/statistics/page.tsx
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import ServerView from "@/components/ServerView";
-import type { Metadata, ResolvingMetadata } from "next";
-import TabServer from "@/components/misc/TabServer";
-import { NewChart } from "@/components/NewChart";
-import ColorProvider from "@/components/ColorProvider";
-import Banner from "@/components/Banner";
-
-type Props = {
- params: { server: string };
-};
-
-export async function generateMetadata(
- { params }: Props,
- parent: ResolvingMetadata
-): Promise {
- // read route params
- const { server } = params;
- const json = await (
- await fetch("https://api.minehut.com/server/" + server + "?byName=true")
- ).json();
-
- return {
- title:
- json.server == null
- ? "Server doesn't exist | MHSF"
- : json.server.name +
- ", " +
- (json.server.online
- ? json.server.playerCount +
- (json.server.maxPlayers != 10
- ? "/" + json.server.maxPlayers
- : "") +
- " online"
- : "Offline") +
- " | MHSF",
- description:
- json.server == null
- ? `The server ${server} doesn't exist.`
- : `View ${server} on Minehut Server Finder!`,
- authors: json.server == null ? undefined : { name: json.server.owner },
- applicationName: "MHSF (Minehut Server Finder)",
- icons:
- json.server == null
- ? undefined
- : "https://mcapi.marveldc.me/item/" +
- (json.server.icon == undefined ? "OAK_SIGN" : json.server.icon) +
- "?width=64&height=64",
- openGraph: {
- type: "profile",
- siteName: "MHSF (Minehut Server Finder)",
- images: [
- {
- url:
- "https://mcapi.marveldc.me/item/" +
- json.server.icon +
- "?width=64&height=64",
- },
- {
- url: "/favicon.ico",
- },
- ],
- },
- };
-}
-
-export default function ServerPage({ params }: { params: { server: string } }) {
- return (
-
-
-
-
-
- Plan Details
-
- Information about the plan being used by the server
-
-
- {(() => {
- console.log(serverObject);
- return true;
- })()}
-
- {" "}
-
-
-
Server plan
-
- {serverObject?.expired == undefined ? (
-
- Free{" "}
-
-
-
-
-
-
-
- The plan is really unknown, but in most
- scenarios, the Minehut API returns{" "}
- undefined if the server is free.
-
-
-
+
+
+ Plan Details
+
+ Information about the plan being used by the server
+
+
+ {(() => {
+ console.log(serverObject);
+ return true;
+ })()}
+
+ {" "}
+
+
+
Server plan
+
+ {serverObject?.expired == undefined ? (
+
+ Free{" "}
+
+
+
+
+
+
+
+ The plan is really unknown, but in most
+ scenarios, the Minehut API returns{" "}
+ undefined if the server is free.
+
+
+
-
-
- <>
- Meet MHSF, the modern
- server finder
- >
-
-
- MHSF is the next generation server list for Minehut, with
- interactive filters, {" "}
- intuitive keyboard shortcuts, and everything between.
-
+ return (
+
+
+ <>
+ {(!isSignedIn || hero) && (
+
+
+
+ <>
+ Meet MHSF, the modern
+ server finder
+ >
+
+
+ MHSF is the next generation server list for Minehut, with
+ interactive filters, {" "}
+ intuitive keyboard shortcuts, and everything between.
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
- For players
-
-
-
-
- Find what you want now, not later
-
-
- Use interactive filters and customization modes to find the
- server of your choice
- in less than 10 minutes.
-
-
-
-
-
+
+
+
+
+
+
+
+ For players
+
+
+
+
+ Find what you want now, not later
+
+
+ Use interactive filters and customization modes to find the
+ server of your choice
+ in less than 10 minutes.
+
+
+
+
+
-
-
-
-
- For server owners
-
-
-
-
- Make your server stand out
-
-
- Servers can have custom banners, Discord widgets, color schemes,
- and descriptions, making your server stand out with information
- that can be shown to players.
-
+ Servers can have custom banners, Discord widgets, color schemes,
+ and descriptions, making your server stand out with information
+ that can be shown to players.
+
- {serverList.getExtraData().total_servers >= 3200 && (
-
-
-
-
-
- The server amount is over 3.2k, meaning that new servers
- have to go into a queue before being able to be online.{" "}
-
- (the server count isn't entirely accurate, so sometimes
- you might not go into a queue even when the server count
- is at 3.2k)
-
-
- )}
-
+ {serverList.getExtraData().total_servers >= 3200 && (
+
+
+
+
+
+ The server amount is over 3.2k, meaning that new servers
+ have to go into a queue before being able to be online.{" "}
+
+ (the server count isn't entirely accurate, so sometimes
+ you might not go into a queue even when the server count
+ is at 3.2k)
+
+
+ )}
+
+ );
}
diff --git a/src/components/clerk/ClerkThemeProvider.tsx b/src/components/clerk/ClerkThemeProvider.tsx
index fd2551c..6e6c081 100644
--- a/src/components/clerk/ClerkThemeProvider.tsx
+++ b/src/components/clerk/ClerkThemeProvider.tsx
@@ -30,50 +30,50 @@
"use client";
import { ClerkProvider } from "@clerk/nextjs";
-import { useTheme } from "next-themes";
import { dark } from "@clerk/themes";
+import { useTheme } from "next-themes";
+import { type ReactNode, useEffect, useState } from "react";
import { ThemeProvider } from "../ThemeProvider";
-import { useEffect, useState } from "react";
export function ClerkThemeProvider({
- children,
- className,
+ children,
+ className,
}: {
- children: JSX.Element;
- className: string;
+ children: ReactNode | ReactNode[];
+ className: string | undefined;
}) {
- const [theme, setTheme] = useState("");
+ const [theme, setTheme] = useState("");
- return (
-
-
-
-
- {children}
- {/** This *has* to be implemented in component form for the `useTheme` to load at the appropriate time. */}
-
-
-
-
-
- );
+ return (
+
+
+
+
+ {children}
+ {/** This *has* to be implemented in component form for the `useTheme` to load at the appropriate time. */}
+
+
+
+
+
+ );
}
function ThemeElement({
- setTheme,
+ setTheme,
}: {
- setTheme: (update: string | undefined) => void;
+ setTheme: (update: string | undefined) => void;
}) {
- const theme = useTheme();
- useEffect(() => {
- setTheme(theme.resolvedTheme);
- }, [theme.resolvedTheme, setTheme]);
- return <>>;
+ const theme = useTheme();
+ useEffect(() => {
+ setTheme(theme.resolvedTheme);
+ }, [theme.resolvedTheme, setTheme]);
+ return <>>;
}
diff --git a/src/components/docs/NavUser.tsx b/src/components/docs/NavUser.tsx
new file mode 100644
index 0000000..87f0a6b
--- /dev/null
+++ b/src/components/docs/NavUser.tsx
@@ -0,0 +1,199 @@
+/*
+ * MHSF, Minehut Server List
+ * All external content is rather licensed under the ECA Agreement
+ * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
+ *
+ * All code under MHSF is licensed under the MIT License
+ * by open source contributors
+ *
+ * Copyright (c) 2024 dvelo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+"use client";
+
+import {
+ BadgeCheck,
+ Bell,
+ ChevronsUpDown,
+ Computer,
+ CreditCard,
+ LogIn,
+ LogOut,
+ Moon,
+ SettingsIcon,
+ Sparkles,
+ Sun,
+} from "lucide-react";
+
+import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
+import {
+ DropdownMenu,
+ DropdownMenuCheckboxItem,
+ DropdownMenuContent,
+ DropdownMenuGroup,
+ DropdownMenuItem,
+ DropdownMenuLabel,
+ DropdownMenuPortal,
+ DropdownMenuRadioGroup,
+ DropdownMenuRadioItem,
+ DropdownMenuSeparator,
+ DropdownMenuSub,
+ DropdownMenuSubContent,
+ DropdownMenuSubTrigger,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
+import {
+ SidebarMenu,
+ SidebarMenuButton,
+ SidebarMenuItem,
+ useSidebar,
+} from "@/components/ui/sidebar";
+import { useClerk, useUser } from "@clerk/nextjs";
+import { useTheme } from "next-themes";
+
+export function NavUser() {
+ const { isMobile } = useSidebar();
+ const { user, isSignedIn } = useUser();
+ const clerk = useClerk();
+ const { setTheme, theme } = useTheme();
+
+ return (
+
+
+
+
+
+ {isSignedIn && (
+
+
+ ?
+
+ )}
+
+
+
+
+ >
+ )}
+
+
+ setTheme(c)}
+ value={theme}
+ >
+
+ Dark
+
+
+ Light
+
+
+ System
+
+
+
+
+ {isSignedIn && (
+ <>
+
+
+ clerk.openUserProfile()}>
+
+ Account Settings
+
+ clerk.signOut()}
+ >
+
+ Log out
+
+
+ >
+ )}
+ {!isSignedIn && (
+ <>
+
+
+ clerk.openSignIn()}>
+
+ Sign in
+
+
+ >
+ )}
+
+
+
+
+ );
+}
diff --git a/src/components/docs/Sidebar.tsx b/src/components/docs/Sidebar.tsx
index e6d46cf..c1a8364 100644
--- a/src/components/docs/Sidebar.tsx
+++ b/src/components/docs/Sidebar.tsx
@@ -1,134 +1,51 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
+import * as React from "react";
-"use client";
-import { allFolders, Docs, DocsFolder } from "@/config/docs";
-import { usePathname } from "next/navigation";
-import { Button } from "../ui/button";
-import { useState } from "react";
-import { ChevronRight } from "lucide-react";
-import { useRouter } from "@/lib/useRouter";
-import { AnimatePresence, motion } from "framer-motion";
+import { NavUser } from "@/components/docs/NavUser";
+import { VersionSwitcher } from "@/components/docs/VersionSwitcher";
+import {
+ Sidebar as ShadSidebar,
+ SidebarContent,
+ SidebarFooter,
+ SidebarGroup,
+ SidebarGroupContent,
+ SidebarGroupLabel,
+ SidebarHeader,
+ SidebarMenu,
+ SidebarMenuButton,
+ SidebarMenuItem,
+ SidebarRail,
+} from "@/components/ui/sidebar";
+import { allFolders } from "@/config/docs";
export function Sidebar() {
- return (
- <>
- {allFolders.map((docs) => (
-
- ))}
- >
- );
-}
-
-function Folder({ docs }: { docs: any }) {
- const [folderOpen, setOpen] = useState(false);
- const router = useRouter();
- const pathname = usePathname();
-
- return (
-
-
-
- {folderOpen && }
-
-
- );
-}
-
-function Subdocs({ docs }: { docs: (Docs | DocsFolder)[] }) {
- const pathname = usePathname();
- const router = useRouter();
- return (
- <>
- {docs.map((doc) => {
- if ("docs" in doc) {
- return ;
- }
- return (
- <>
-
-
- >
- );
- })}
- >
- );
+ return (
+
+
+
+
+
+ {/* We create a SidebarGroup for each parent. */}
+ {allFolders.map((item) => (
+
+ {item.name}
+
+
+ {item.docs.map((item) => (
+
+
+ {item.title}
+
+
+ ))}
+
+
+
+ ))}
+
+
+
+
+
+
+ );
}
diff --git a/src/components/misc/InfoPopover.tsx b/src/components/misc/InfoPopover.tsx
index fc653e8..0a48dcd 100644
--- a/src/components/misc/InfoPopover.tsx
+++ b/src/components/misc/InfoPopover.tsx
@@ -28,59 +28,51 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-import { Button } from "../ui/button";
-import { Book, Calendar, Star, TerminalIcon } from "lucide-react";
-import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../ui/dialog";
-import { useState } from "react";
-import { Changelog, version } from "@/config/version";
+import { Changelog } from "@/components/changelog";
+import { changelog, version } from "@/config/version";
import events from "@/lib/commandEvent";
-import { ScrollArea } from "../ui/scroll-area";
import { useRouter } from "@/lib/useRouter";
+import { Book, Calendar, Star, TerminalIcon } from "lucide-react";
+import { useState } from "react";
+import { Button } from "../ui/button";
+import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../ui/dialog";
+import { ScrollArea } from "../ui/scroll-area";
export default function InfoPopover() {
- const [changeLog, setChangelog] = useState(false);
- const router = useRouter();
+ const router = useRouter();
- return (
-
- The future of Minehut lists
-
- Use filters, intuitive keyboard shortcuts and other features for
- completely free, and *open-source. Currently on version{" "}
- {version}. {" "}
- * Licensed under the MIT License
-
+ return (
+
+ The future of Minehut lists
+
+ Use filters, intuitive keyboard shortcuts and other features for
+ completely free, and *open-source. Currently on version{" "}
+ {version}. {" "}
+ * Licensed under the MIT License
+
-
-
-
-
-
- Changelog
-
-
-
-
-
+
+
+
-
-
-
-
- );
+
+
+
+
+ );
}
diff --git a/src/components/misc/MiniJoinsChart.tsx b/src/components/misc/MiniJoinsChart.tsx
new file mode 100644
index 0000000..a521002
--- /dev/null
+++ b/src/components/misc/MiniJoinsChart.tsx
@@ -0,0 +1,111 @@
+/*
+ * MHSF, Minehut Server List
+ * All external content is rather licensed under the ECA Agreement
+ * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
+ *
+ * All code under MHSF is licensed under the MIT License
+ * by open source contributors
+ *
+ * Copyright (c) 2024 dvelo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+import {
+ type ChartConfig,
+ ChartContainer,
+ ChartTooltip,
+ ChartTooltipContent,
+} from "@/components/ui/chart";
+import { getShortTermData } from "@/lib/api";
+import { useEffectOnce } from "@/lib/useEffectOnce";
+import * as React from "react";
+import { CartesianGrid, Line, LineChart, XAxis, YAxis } from "recharts";
+
+const chartConfig = {
+ player_count: {
+ label: "Joins",
+ color: "hsl(var(--chart-1))",
+ },
+} satisfies ChartConfig;
+
+export function MiniJoinsChart({ server }: { server: string }) {
+ const [chartData, setChartData] = React.useState([]);
+ const [loading, setLoading] = React.useState(true);
+
+ useEffectOnce(() => {
+ getShortTermData(server, ["player_count", "date"]).then((result) => {
+ setChartData(result.slice(-20));
+ setLoading(false);
+ });
+ });
+
+ return (
+
• Fixed right-click context menu on the server list
-
• Fixed metadata bugs
-
-
-
- Hey! Update on statistics. Recently, we have figured out the Minehut
- API is blocked to Vercel servers (atleast the /servers{" "}
- endpoint). I'm actively trying to find a loop-hole so that statistics
- works correctly. Thank you {":)"}
-
-
-
• Fixed right-click context menu on the server list
+
• Fixed metadata bugs
+
+
+
+ Hey! Update on statistics. Recently, we have figured out the Minehut
+ API is blocked to Vercel servers (atleast the /servers{" "}
+ endpoint). I'm actively trying to find a loop-hole so that statistics
+ works correctly. Thank you {":)"}
+
+
+