From 3e1f94bf78e151e220e08675e417475886b13765 Mon Sep 17 00:00:00 2001
From: dvelo <52332868+DeveloLongScript@users.noreply.github.com>
Date: Wed, 21 May 2025 20:45:21 -0500
Subject: [PATCH] feat: v2 beta
---
.vscode/settings.json | 5 +-
apps/www/next.config.mjs | 4 +
apps/www/package.json | 2 +-
apps/www/src/app/(main)/layout.tsx | 61 ++---
.../app/(sl-modification-frame)/layout.tsx | 2 +-
.../[category]/modification/[mod]/page.tsx | 64 ++---
.../modification/custom/[custom-mod]/page.tsx | 10 +-
.../embedded/sl-modification-frame/page.tsx | 2 -
apps/www/src/app/globals.css | 6 +-
apps/www/src/app/layout.tsx | 3 +-
apps/www/src/components/feat/embeds/embed.tsx | 2 +-
.../www/src/components/feat/footer/footer.tsx | 4 +-
.../feat/server-list/server-list.tsx | 9 +-
.../discord/server-discord-row.tsx | 25 ++
.../feat/server-page/motd/motd-row.tsx | 2 +-
.../customizations/server-discord-box.tsx | 115 ++++++++
.../customizations/server-unown-box.tsx | 126 +++++++++
.../server-editor/server-editor-provider.tsx | 55 ++--
.../feat/server-page/server-provider.tsx | 4 +-
.../feat/server-page/server-rows.tsx | 4 +-
.../feat/settings/account-settings.tsx | 235 +++++++++++++++++
.../feat/settings/browser-settings.tsx | 222 +++++++++-------
.../feat/settings/linking-dialog.tsx | 248 ++++++++++++++++++
.../src/components/feat/settings/settings.tsx | 2 +
.../feat/waitlist/waitlist-page.tsx | 6 +-
apps/www/src/components/ui/dialog.tsx | 2 +-
apps/www/src/components/ui/input-otp.tsx | 77 ++++++
.../www/src/components/util/font-boundary.tsx | 2 +
apps/www/src/lib/api.ts | 6 +-
apps/www/src/lib/check-owned-server.ts | 2 +-
apps/www/src/lib/hooks/use-filters.tsx | 8 +-
.../hooks/use-minecraft-head.tsx} | 41 +--
.../favorites.ts => lib/hooks/use-user.tsx} | 67 +++--
.../pages/api/v1/server/get/[server]/index.ts | 132 +++++++---
.../api/v1/server/get/[server]/own-server.ts | 2 +-
.../get/[server]/settings/change-discord.ts} | 61 +++--
.../get/[server]/settings/unlink-server.ts} | 35 ++-
.../user}/claim-account-code.ts | 11 +-
apps/www/src/pages/api/v1/user/get.ts | 88 +++++++
yarn.lock | 4 +-
40 files changed, 1402 insertions(+), 354 deletions(-)
create mode 100644 apps/www/src/components/feat/server-page/discord/server-discord-row.tsx
create mode 100644 apps/www/src/components/feat/server-page/server-editor/customizations/server-discord-box.tsx
create mode 100644 apps/www/src/components/feat/server-page/server-editor/customizations/server-unown-box.tsx
create mode 100644 apps/www/src/components/feat/settings/account-settings.tsx
create mode 100644 apps/www/src/components/feat/settings/linking-dialog.tsx
create mode 100644 apps/www/src/components/ui/input-otp.tsx
rename apps/www/src/{pages/api/v0/sorting/favorites.ts => lib/hooks/use-minecraft-head.tsx} (64%)
rename apps/www/src/{pages/api/v1/user/favorites.ts => lib/hooks/use-user.tsx} (58%)
rename apps/www/src/pages/api/{v0/account-sl/change.ts => v1/server/get/[server]/settings/change-discord.ts} (59%)
rename apps/www/src/pages/api/v1/{user/claimed-user.ts => server/get/[server]/settings/unlink-server.ts} (66%)
rename apps/www/src/pages/api/{v0/account-linking => v1/user}/claim-account-code.ts (89%)
create mode 100644 apps/www/src/pages/api/v1/user/get.ts
diff --git a/.vscode/settings.json b/.vscode/settings.json
index e68acd7..83317c5 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,3 +1,6 @@
{
- "copyright-header-injector.copyrightText": "/*\n * MHSF, Minehut Server List\n * All external content is rather licensed under the ECA Agreement\n * located here: https://mhsf.app/docs/legal/external-content-agreement\n *\n * All code under MHSF is licensed under the MIT License\n * by open source contributors\n *\n * Copyright (c) 2025 dvelo\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */"
+ "copyright-header-injector.copyrightText": "/*\n * MHSF, Minehut Server List\n * All external content is rather licensed under the ECA Agreement\n * located here: https://mhsf.app/docs/legal/external-content-agreement\n *\n * All code under MHSF is licensed under the MIT License\n * by open source contributors\n *\n * Copyright (c) 2025 dvelo\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */",
+ "cSpell.words": [
+ "MHSF"
+ ]
}
\ No newline at end of file
diff --git a/apps/www/next.config.mjs b/apps/www/next.config.mjs
index 7d9a7cc..b62a329 100644
--- a/apps/www/next.config.mjs
+++ b/apps/www/next.config.mjs
@@ -51,6 +51,10 @@ const nextConfig = {
hostname: "exh89c9lva.ufs.sh",
pathname: "/f/*",
},
+ {
+ protocol: "https",
+ hostname: "api.mineatar.io"
+ }
],
},
async redirects() {
diff --git a/apps/www/package.json b/apps/www/package.json
index a02c5a4..93d0f4a 100644
--- a/apps/www/package.json
+++ b/apps/www/package.json
@@ -68,7 +68,7 @@
"framer-motion": "^12.7.4",
"github-slugger": "^2.0.0",
"inngest": "^3.21.2",
- "input-otp": "^1.2.4",
+ "input-otp": "^1.4.2",
"json-beautify": "^1.1.1",
"lodash": "^4.17.21",
"lucide-react": "^0.487.0",
diff --git a/apps/www/src/app/(main)/layout.tsx b/apps/www/src/app/(main)/layout.tsx
index 8975969..5a8357a 100644
--- a/apps/www/src/app/(main)/layout.tsx
+++ b/apps/www/src/app/(main)/layout.tsx
@@ -40,36 +40,37 @@ import { Footer } from "@/components/feat/footer/footer";
import { NuqsAdapter } from "nuqs/adapters/next/app";
export default function RootLayout({
- children,
+ children,
}: {
- children: React.ReactNode;
+ children: React.ReactNode;
}) {
-
- return (
- <>
-
-
-
-
-
-
-
-
-
-
-
- This is a custom modification. Enable it! (or not) It's your own! (are
- you proud?)
-
+
+
+ This is a custom modification. Enable it! (or not) It's your own!
+ (are you proud?)
+
+
-
+
MHSF is an open-source project licensed under the MIT license. MHSF is
not officially affiliated with with Minehut, Super League Enterprise,
diff --git a/apps/www/src/components/feat/server-list/server-list.tsx b/apps/www/src/components/feat/server-list/server-list.tsx
index 680aa4b..c24f23b 100644
--- a/apps/www/src/components/feat/server-list/server-list.tsx
+++ b/apps/www/src/components/feat/server-list/server-list.tsx
@@ -103,14 +103,7 @@ export function ServerList() {
)}
diff --git a/apps/www/src/components/feat/server-page/server-editor/customizations/server-discord-box.tsx b/apps/www/src/components/feat/server-page/server-editor/customizations/server-discord-box.tsx
new file mode 100644
index 0000000..645ee23
--- /dev/null
+++ b/apps/www/src/components/feat/server-page/server-editor/customizations/server-discord-box.tsx
@@ -0,0 +1,115 @@
+/*
+ * MHSF, Minehut Server List
+ * All external content is rather licensed under the ECA Agreement
+ * located here: https://mhsf.app/docs/legal/external-content-agreement
+ *
+ * All code under MHSF is licensed under the MIT License
+ * by open source contributors
+ *
+ * Copyright (c) 2025 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 { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import { Material } from "@/components/ui/material";
+import { useEffect, useState } from "react";
+import ShikiHighlighter from "react-shiki";
+import { toast } from "sonner";
+
+export function ServerDiscordBox({
+ mhsfServer,
+ defaultDiscord,
+}: { mhsfServer: string; defaultDiscord: string }) {
+ const [serverId, setServerId] = useState(defaultDiscord);
+ const [allowed, setAllowed] = useState(false);
+
+ useEffect(() => {
+ (async () => {
+ setAllowed(false);
+ if (
+ serverId.length <= 25 &&
+ serverId.length > 3 &&
+ /^\d+$/.test(serverId as string)
+ ) {
+ const { ok, body } = await fetch(
+ `https://discord.com/api/guilds/${serverId}/widget.json`,
+ );
+ if (ok) setAllowed(true);
+ }
+ })();
+ }, [serverId]);
+
+ return (
+
+ Discord Embed
+
+
+
+ Enable Discord widgets in your server settings (Settings -{">"}{" "}
+ Engagement -{">"} Enable Server Widget) to use this.
+ Note: We'll handle all of the query variables on the URL for you
+ (like theming and usernames).
+
+
+ );
+}
diff --git a/apps/www/src/components/feat/server-page/server-editor/customizations/server-unown-box.tsx b/apps/www/src/components/feat/server-page/server-editor/customizations/server-unown-box.tsx
new file mode 100644
index 0000000..5fe070d
--- /dev/null
+++ b/apps/www/src/components/feat/server-page/server-editor/customizations/server-unown-box.tsx
@@ -0,0 +1,126 @@
+/*
+ * MHSF, Minehut Server List
+ * All external content is rather licensed under the ECA Agreement
+ * located here: https://mhsf.app/docs/legal/external-content-agreement
+ *
+ * All code under MHSF is licensed under the MIT License
+ * by open source contributors
+ *
+ * Copyright (c) 2025 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 {
+ Setting,
+ SettingContent,
+ SettingDescription,
+ SettingMeta,
+ SettingTitle,
+} from "@/components/feat/settings/setting";
+import { Button } from "@/components/ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogTitle,
+ DialogTrigger,
+} from "@/components/ui/dialog";
+import { Drawer, DrawerContent, DrawerTrigger } from "@/components/ui/drawer";
+import { Input } from "@/components/ui/input";
+import { Material } from "@/components/ui/material";
+import type { useMHSFServer } from "@/lib/hooks/use-mhsf-server";
+import type { ServerResponse } from "@/lib/types/mh-server";
+import { useState } from "react";
+import { toast } from "sonner";
+
+export function ServerUnownBox({
+ mhsfData,
+ serverData,
+ reset,
+}: {
+ mhsfData: ReturnType;
+ serverData: ServerResponse;
+ reset: () => void;
+}) {
+ const [input, setInput] = useState("");
+
+ return (
+
+
+
+
+ Unlink server
+ This cannot be undone.
+
+
+
+ Unlink
+
+
+
+ Are you sure?
+
+ Unlinking a server will remove all customizations of it and
+ you will not be able to customize your server again until you
+ link the server again.
+
-
+ }) {
const clipboard = useClipboard();
@@ -46,8 +47,9 @@ export function ServerRows({ server, mhsfData }: { server: ServerResponse, mhsfD
return (
{affiliates.includes(server.name) && }
-
+
+ {mhsfData.server?.customizationData.discord !== undefined && }
diff --git a/apps/www/src/components/feat/settings/account-settings.tsx b/apps/www/src/components/feat/settings/account-settings.tsx
new file mode 100644
index 0000000..599fae2
--- /dev/null
+++ b/apps/www/src/components/feat/settings/account-settings.tsx
@@ -0,0 +1,235 @@
+/*
+ * MHSF, Minehut Server List
+ * All external content is rather licensed under the ECA Agreement
+ * located here: https://mhsf.app/docs/legal/external-content-agreement
+ *
+ * All code under MHSF is licensed under the MIT License
+ * by open source contributors
+ *
+ * Copyright (c) 2025 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 { Material } from "@/components/ui/material";
+import {
+ Setting,
+ SettingContent,
+ SettingDescription,
+ SettingMeta,
+ SettingTitle,
+} from "./setting";
+import { Button } from "@/components/ui/button";
+import { Spinner } from "@/components/ui/spinner";
+import { LinkingDialog } from "./linking-dialog";
+import { useUser } from "@/lib/hooks/use-user";
+import { toast } from "sonner";
+import { useMinecraftHead } from "@/lib/hooks/use-minecraft-head";
+import Image from "next/image";
+import { Placeholder } from "@/components/ui/placeholder";
+import { EllipsisVertical, Star, StarOff } from "lucide-react";
+import { useRouter } from "@/lib/useRouter";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
+import { ServerResponse } from "@/lib/types/mh-server";
+import { useEffect, useState } from "react";
+import { useEffectOnce } from "@/lib/useEffectOnce";
+
+export function AccountSettings() {
+ const { user, refresh } = useUser();
+ const router = useRouter();
+
+ if (user !== null)
+ return (
+
+
Link Account
+
+
+
+ Link Account
+
+ Link a Minecraft account to confirm you own a server and
+ customize it with certain information to make it look better to
+ other MHSF users.
+
+
+
+
+ {user?.claimedUser === null
+ ? "Link Account"
+ : "(account already linked)"}
+
+
+
+
+
+
+
+ Unlink Account
+
+ {
+ toast.promise(
+ fetch(user?.actions.unlinkAccount as string).then(() =>
+ refresh(),
+ ),
+ {
+ loading: "Unlinking...",
+ success: "Unlinked!",
+ error: "Failed to unlink",
+ },
+ );
+ }}
+ >
+ Unlink
+
+
+
+ {user.claimedUser !== null && (
+
+
+
+ Account Name
+
+
-
-
-
- Color Scheme
-
- Change the MHSF color scheme
-
-
-
-
-
-
-
-
- Use Minecraft font
-
- Use Minecraft font for MOTD. Turning this off restores font
- settings for MOTD's to a v1-like state.
-
-
- {
- settingsStore.set("mc-font", c, false);
- setMcFont(c);
- }}
- />
-
-
-
-
-
- Font
-
- Change the default font used in the interface.
-
-
-
-
-
-
-
-
- Debug Mode
- Enable debug mode to show debug options
-
- {
- settingsStore.set("debug-mode", c, false);
- window.dispatchEvent(new Event("debug-mode-change"));
- setDebugMode(c);
- }}
- />
-
-
-
- );
+ return (
+
+
Support
+
+
+
+ Donate
+
+ Please consider supporting me if you think this project is useful
+ to you, this project is completely open-source and I do not get
+ any money from it.
+
+
+
+ Donate
+
+
+
+
+
Appearance
+
+
+
+ Color Scheme
+
+ Change the MHSF color scheme
+
+
+
+
+
+
+
+
+ Use Minecraft font
+
+ Use Minecraft font for MOTD. Turning this off restores font
+ settings for MOTD's to a v1-like state.
+
+
+ {
+ settingsStore.set("mc-font", c, false);
+ setMcFont(c);
+ }}
+ />
+
+
+
+
+
+ Font
+
+ Change the default font used in the interface.
+
+
+
+
+
+
+
+
+ Debug Mode
+
+ Enable debug mode to show debug options
+
+
+ {
+ settingsStore.set("debug-mode", c, false);
+ window.dispatchEvent(new Event("debug-mode-change"));
+ setDebugMode(c);
+ }}
+ />
+
+
+
+ );
}
diff --git a/apps/www/src/components/feat/settings/linking-dialog.tsx b/apps/www/src/components/feat/settings/linking-dialog.tsx
new file mode 100644
index 0000000..94e9f80
--- /dev/null
+++ b/apps/www/src/components/feat/settings/linking-dialog.tsx
@@ -0,0 +1,248 @@
+/*
+ * MHSF, Minehut Server List
+ * All external content is rather licensed under the ECA Agreement
+ * located here: https://mhsf.app/docs/legal/external-content-agreement
+ *
+ * All code under MHSF is licensed under the MIT License
+ * by open source contributors
+ *
+ * Copyright (c) 2025 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 Link from "next/link";
+import { ChevronLeft, ServerOff } from "lucide-react";
+import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
+import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
+import { ReactNode, useState } from "react";
+import { DialogTitle } from "@radix-ui/react-dialog";
+import { Button } from "@/components/ui/button";
+import {
+ InputOTP,
+ InputOTPGroup,
+ InputOTPSlot,
+} from "@/components/ui/input-otp";
+import { useUser } from "@clerk/nextjs";
+import Image from "next/image";
+import { REGEXP_ONLY_DIGITS } from "input-otp";
+import { cn } from "@/lib/utils";
+import { FormSpinner } from "@/components/ui/form-spinner";
+
+export function LinkingDialog({ children, refresh }: { children: ReactNode, refresh: () => Promise }) {
+ const [step, setStep] = useState(0);
+ const { user } = useUser();
+ const [error, setError] = useState(false);
+ const [code, setCode] = useState("");
+ const [loading, setLoading] = useState(false);
+ const [username, setUserName] = useState("");
+
+ const onSubmit = async (code: string) => {
+ setLoading(true);
+ const fetchRes = await fetch(
+ `/api/v1/user/claim-account-code?code=${code}`,
+ );
+ const json = await fetchRes.json();
+
+ if (!fetchRes.ok) {
+ setError(true);
+ setLoading(false);
+ return;
+ }
+ setUserName(json.player);
+ setStep(2);
+ setLoading(false);
+ refresh();
+ };
+
+ return (
+
+ );
+}
diff --git a/apps/www/src/components/feat/settings/settings.tsx b/apps/www/src/components/feat/settings/settings.tsx
index d4aff24..258d682 100644
--- a/apps/www/src/components/feat/settings/settings.tsx
+++ b/apps/www/src/components/feat/settings/settings.tsx
@@ -40,6 +40,7 @@ import { BrowserSettings } from "./browser-settings";
import { useSettingsStore } from "@/lib/hooks/use-settings-store";
import { useEffect, useState } from "react";
import { DebugSettings } from "./debug-settings";
+import { AccountSettings } from "./account-settings";
export function Settings() {
const settingsStore = useSettingsStore();
@@ -101,6 +102,7 @@ export function Settings() {
+
v2 private beta
-
+
Hello there! MHSF has an exclusive beta that you may have been invited{" "}
to. Please sign into your account below or follow the
instructions.
@@ -67,8 +67,8 @@ export function WaitlistPage() {
You must be signed in to check for eligibility for this beta. Please
- make sure you use the Discord connection so we can check if you
- eligibile for the beta.
+ make sure you use the Discord connection so we can check if you are
+ eligible for the beta.