mirror of
https://github.com/DeveloLongScript/MHSF.git
synced 2026-05-07 21:14:59 -05:00
fix: errors
This commit is contained in:
parent
c8fe0a6051
commit
e0d96b47cd
@ -1,48 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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) 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 SignUpPage from "@/components/clerk/SignInForm";
|
|
||||||
import { ServerCrash } from "lucide-react";
|
|
||||||
|
|
||||||
export default function Page() {
|
|
||||||
return (
|
|
||||||
<div className="flex min-h-svh flex-col items-center justify-center gap-6 bg-[rgb(244,_244,_245)] p-6 md:p-10">
|
|
||||||
<div className="flex w-full max-w-sm flex-col gap-6">
|
|
||||||
<a href="/" className="flex items-center gap-2 self-center font-medium">
|
|
||||||
<div className="flex h-6 w-6 items-center justify-center rounded-md bg-primary text-primary-foreground">
|
|
||||||
<ServerCrash className="size-4" />
|
|
||||||
</div>
|
|
||||||
MHSF
|
|
||||||
</a>
|
|
||||||
<SignUpPage />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
import { ClerkProvider } from "@clerk/nextjs";
|
|
||||||
import "@/app/globals.css";
|
|
||||||
import { GeistSans } from "geist/font/sans";
|
|
||||||
|
|
||||||
export const metadata = {
|
|
||||||
title: "Next.js",
|
|
||||||
description: "Generated by Next.js",
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function RootLayout({
|
|
||||||
children,
|
|
||||||
}: {
|
|
||||||
children: React.ReactNode;
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<html lang="en" className={GeistSans.className}>
|
|
||||||
<body>
|
|
||||||
<ClerkProvider>{children}</ClerkProvider>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,311 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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) 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 * as Clerk from "@clerk/elements/common";
|
|
||||||
import * as SignUp from "@clerk/elements/sign-up";
|
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import {
|
|
||||||
Card,
|
|
||||||
CardContent,
|
|
||||||
CardDescription,
|
|
||||||
CardFooter,
|
|
||||||
CardHeader,
|
|
||||||
CardTitle,
|
|
||||||
} from "@/components/ui/card";
|
|
||||||
import { Input } from "@/components/ui/input";
|
|
||||||
import { Label } from "@/components/ui/label";
|
|
||||||
import { cn } from "@/lib/utils";
|
|
||||||
import { LoadingSpinner } from "../ui/loading-spinner";
|
|
||||||
import Discord from "../ui/discord";
|
|
||||||
import Github from "../ui/github";
|
|
||||||
|
|
||||||
export default function SignUpPage() {
|
|
||||||
return (
|
|
||||||
<div className="flex flex-col gap-6">
|
|
||||||
<SignUp.Root
|
|
||||||
fallback={
|
|
||||||
<Card className="flex items-center justify-center float-center absolute left-[50%] translate-x-[-50%] size-[50px]">
|
|
||||||
<LoadingSpinner />
|
|
||||||
</Card>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Clerk.Loading>
|
|
||||||
{(isGlobalLoading) => (
|
|
||||||
<>
|
|
||||||
{isGlobalLoading && (
|
|
||||||
<Card className="flex items-center justify-center float-center absolute left-[50%] translate-x-[-50%] size-[50px]">
|
|
||||||
<LoadingSpinner />
|
|
||||||
</Card>
|
|
||||||
)}
|
|
||||||
<SignUp.Step name="start">
|
|
||||||
<Card className="w-full sm:w-96 ">
|
|
||||||
<CardHeader className="text-center">
|
|
||||||
<CardTitle>Create your account</CardTitle>
|
|
||||||
<CardDescription>
|
|
||||||
Welcome! Please fill in the details to get started.
|
|
||||||
</CardDescription>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent className="grid gap-y-4">
|
|
||||||
<div className="grid gap-2 grid-cols-2">
|
|
||||||
<Clerk.Connection name="discord" asChild>
|
|
||||||
<Button
|
|
||||||
size="sm"
|
|
||||||
variant="outline"
|
|
||||||
type="button"
|
|
||||||
className="flex items-center"
|
|
||||||
disabled={isGlobalLoading}
|
|
||||||
>
|
|
||||||
<Clerk.Loading scope="provider:discord">
|
|
||||||
{(isLoading) =>
|
|
||||||
isLoading ? (
|
|
||||||
<LoadingSpinner className="size-4 " />
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<Discord className="mr-2 size-4" />
|
|
||||||
Discord
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</Clerk.Loading>
|
|
||||||
</Button>
|
|
||||||
</Clerk.Connection>
|
|
||||||
<Clerk.Connection name="github" asChild>
|
|
||||||
<Button
|
|
||||||
size="sm"
|
|
||||||
variant="outline"
|
|
||||||
type="button"
|
|
||||||
className="flex items-center"
|
|
||||||
disabled={isGlobalLoading}
|
|
||||||
>
|
|
||||||
<Clerk.Loading scope="provider:github">
|
|
||||||
{(isLoading) =>
|
|
||||||
isLoading ? (
|
|
||||||
<LoadingSpinner className="size-4 " />
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<Github
|
|
||||||
className="mr-2 size-4"
|
|
||||||
fill="black"
|
|
||||||
/>
|
|
||||||
GitHub
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</Clerk.Loading>
|
|
||||||
</Button>
|
|
||||||
</Clerk.Connection>
|
|
||||||
</div>
|
|
||||||
<p className="flex items-center gap-x-3 text-sm text-muted-foreground before:h-px before:flex-1 before:bg-border after:h-px after:flex-1 after:bg-border">
|
|
||||||
or
|
|
||||||
</p>
|
|
||||||
<Clerk.Field name="emailAddress" className="space-y-2">
|
|
||||||
<Clerk.Label asChild>
|
|
||||||
<Label>Email address</Label>
|
|
||||||
</Clerk.Label>
|
|
||||||
<Clerk.Input type="email" required asChild>
|
|
||||||
<Input />
|
|
||||||
</Clerk.Input>
|
|
||||||
<Clerk.FieldError className="block text-sm text-destructive" />
|
|
||||||
</Clerk.Field>
|
|
||||||
<Clerk.Field name="password" className="space-y-2">
|
|
||||||
<Clerk.Label asChild>
|
|
||||||
<Label>Password</Label>
|
|
||||||
</Clerk.Label>
|
|
||||||
<Clerk.Input type="password" required asChild>
|
|
||||||
<Input />
|
|
||||||
</Clerk.Input>
|
|
||||||
<Clerk.FieldError className="block text-sm text-destructive" />
|
|
||||||
</Clerk.Field>
|
|
||||||
</CardContent>
|
|
||||||
<CardFooter>
|
|
||||||
<div className="grid w-full gap-y-4">
|
|
||||||
<SignUp.Captcha className="empty:hidden" />
|
|
||||||
<SignUp.Action submit asChild>
|
|
||||||
<Button
|
|
||||||
disabled={isGlobalLoading}
|
|
||||||
className="flex items-center"
|
|
||||||
>
|
|
||||||
<Clerk.Loading>
|
|
||||||
{(isLoading) => {
|
|
||||||
return isLoading ? (
|
|
||||||
<LoadingSpinner className="size-4 " />
|
|
||||||
) : (
|
|
||||||
"Continue"
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</Clerk.Loading>
|
|
||||||
</Button>
|
|
||||||
</SignUp.Action>
|
|
||||||
<Button variant="link" size="sm" asChild>
|
|
||||||
<Clerk.Link navigate="sign-in">
|
|
||||||
Already have an account? Sign in
|
|
||||||
</Clerk.Link>
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</CardFooter>
|
|
||||||
</Card>
|
|
||||||
</SignUp.Step>
|
|
||||||
|
|
||||||
<SignUp.Step name="continue">
|
|
||||||
<Card className="w-full sm:w-96 ">
|
|
||||||
<CardHeader>
|
|
||||||
<CardTitle>Continue registration</CardTitle>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent>
|
|
||||||
<Clerk.Field name="username" className="space-y-2">
|
|
||||||
<Clerk.Label>
|
|
||||||
<Label>Username</Label>
|
|
||||||
</Clerk.Label>
|
|
||||||
<Clerk.Input type="text" required asChild>
|
|
||||||
<Input />
|
|
||||||
</Clerk.Input>
|
|
||||||
<Clerk.FieldError className="block text-sm text-destructive" />
|
|
||||||
</Clerk.Field>
|
|
||||||
</CardContent>
|
|
||||||
<CardFooter>
|
|
||||||
<div className="grid w-full gap-y-4">
|
|
||||||
<SignUp.Action submit asChild>
|
|
||||||
<Button
|
|
||||||
disabled={isGlobalLoading}
|
|
||||||
className="flex items-center"
|
|
||||||
>
|
|
||||||
<Clerk.Loading>
|
|
||||||
{(isLoading) => {
|
|
||||||
return isLoading ? (
|
|
||||||
<LoadingSpinner className="size-4 " />
|
|
||||||
) : (
|
|
||||||
"Continue"
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</Clerk.Loading>
|
|
||||||
</Button>
|
|
||||||
</SignUp.Action>
|
|
||||||
</div>
|
|
||||||
</CardFooter>
|
|
||||||
</Card>
|
|
||||||
</SignUp.Step>
|
|
||||||
|
|
||||||
<SignUp.Step name="verifications">
|
|
||||||
<SignUp.Strategy name="email_code">
|
|
||||||
<Card className="w-full sm:w-96 ">
|
|
||||||
<CardHeader>
|
|
||||||
<CardTitle>Verify your email</CardTitle>
|
|
||||||
<CardDescription>
|
|
||||||
Use the verification link sent to your email address
|
|
||||||
</CardDescription>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent className="grid gap-y-4">
|
|
||||||
<div className="grid items-center justify-center gap-y-2">
|
|
||||||
<Clerk.Field name="code" className="space-y-2">
|
|
||||||
<Clerk.Label className="sr-only">
|
|
||||||
Email address
|
|
||||||
</Clerk.Label>
|
|
||||||
<div className="flex justify-center text-center">
|
|
||||||
<Clerk.Input
|
|
||||||
type="otp"
|
|
||||||
className="flex justify-center has-[:disabled]:opacity-50"
|
|
||||||
autoSubmit
|
|
||||||
render={({ value, status }) => {
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
data-status={status}
|
|
||||||
className={cn(
|
|
||||||
"relative flex size-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",
|
|
||||||
{
|
|
||||||
"z-10 ring-2 ring-ring ring-offset-background":
|
|
||||||
status === "cursor" ||
|
|
||||||
status === "selected",
|
|
||||||
}
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{value}
|
|
||||||
{status === "cursor" && (
|
|
||||||
<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
|
|
||||||
<div className="animate-caret-blink h-4 w-px bg-foreground duration-1000" />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<Clerk.FieldError className="block text-center text-sm text-destructive" />
|
|
||||||
</Clerk.Field>
|
|
||||||
<SignUp.Action
|
|
||||||
asChild
|
|
||||||
resend
|
|
||||||
className="text-muted-foreground"
|
|
||||||
fallback={({ resendableAfter }) => (
|
|
||||||
<Button variant="link" size="sm" disabled>
|
|
||||||
Didn't receive a code? Resend (
|
|
||||||
<span className="tabular-nums">
|
|
||||||
{resendableAfter}
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<Button type="button" variant="link" size="sm">
|
|
||||||
Didn't receive a code? Resend
|
|
||||||
</Button>
|
|
||||||
</SignUp.Action>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
<CardFooter>
|
|
||||||
<div className="grid w-full gap-y-4">
|
|
||||||
<SignUp.Action submit asChild>
|
|
||||||
<Button
|
|
||||||
disabled={isGlobalLoading}
|
|
||||||
className="flex items-center"
|
|
||||||
>
|
|
||||||
<Clerk.Loading>
|
|
||||||
{(isLoading) => {
|
|
||||||
return isLoading ? (
|
|
||||||
<LoadingSpinner className="size-4 " />
|
|
||||||
) : (
|
|
||||||
"Continue"
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</Clerk.Loading>
|
|
||||||
</Button>
|
|
||||||
</SignUp.Action>
|
|
||||||
</div>
|
|
||||||
</CardFooter>
|
|
||||||
</Card>
|
|
||||||
</SignUp.Strategy>
|
|
||||||
</SignUp.Step>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Clerk.Loading>
|
|
||||||
</SignUp.Root>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,99 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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) 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 {
|
|
||||||
DropdownMenu,
|
|
||||||
DropdownMenuContent,
|
|
||||||
DropdownMenuTrigger,
|
|
||||||
} from "../ui/dropdown-menu";
|
|
||||||
import { Button } from "../ui/button";
|
|
||||||
import { ChevronDown } from "lucide-react";
|
|
||||||
|
|
||||||
export function ServerListNav() {
|
|
||||||
return (
|
|
||||||
<div className="w-full max-w-6xl mx-auto p-4">
|
|
||||||
<div className="space-y-4">
|
|
||||||
<h1 className="text-xl font-semibold">Links</h1>
|
|
||||||
<div className="flex flex-col sm:flex-row items-stretch sm:items-center sm:justify-between gap-2 sm:gap-8">
|
|
||||||
<div className="grid grid-cols-2 sm:flex sm:flex-row items-stretch sm:items-center gap-2">
|
|
||||||
<DropdownMenu>
|
|
||||||
<DropdownMenuTrigger asChild>
|
|
||||||
<Button variant="outline" className="w-full gap-2">
|
|
||||||
Filter
|
|
||||||
<ChevronDown className="h-4 w-4" />
|
|
||||||
</Button>
|
|
||||||
</DropdownMenuTrigger>
|
|
||||||
<DropdownMenuContent>
|
|
||||||
<DropdownMenuGroup>
|
|
||||||
<DropdownMenuItem>All links</DropdownMenuItem>
|
|
||||||
<DropdownMenuItem>Active links</DropdownMenuItem>
|
|
||||||
<DropdownMenuItem>Archived links</DropdownMenuItem>
|
|
||||||
</DropdownMenuGroup>
|
|
||||||
</DropdownMenuContent>
|
|
||||||
</DropdownMenu>
|
|
||||||
|
|
||||||
<DropdownMenu>
|
|
||||||
<DropdownMenuTrigger asChild>
|
|
||||||
<Button variant="outline" className="w-full gap-2">
|
|
||||||
Display
|
|
||||||
<ChevronDown className="h-4 w-4" />
|
|
||||||
</Button>
|
|
||||||
</DropdownMenuTrigger>
|
|
||||||
<DropdownMenuContent>
|
|
||||||
<DropdownMenuGroup>
|
|
||||||
<DropdownMenuItem>List view</DropdownMenuItem>
|
|
||||||
<DropdownMenuItem>Grid view</DropdownMenuItem>
|
|
||||||
<DropdownMenuItem>Compact view</DropdownMenuItem>
|
|
||||||
</DropdownMenuGroup>
|
|
||||||
</DropdownMenuContent>
|
|
||||||
</DropdownMenu>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex items-center gap-2 w-full sm:w-auto">
|
|
||||||
<div className="relative flex-1">
|
|
||||||
<Search className="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" />
|
|
||||||
<Input type="search" placeholder="Search..." className="pl-8" />
|
|
||||||
</div>
|
|
||||||
<Button className="shrink-0 gap-2">
|
|
||||||
Create link
|
|
||||||
<kbd className="pointer-events-none hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 sm:flex">
|
|
||||||
C
|
|
||||||
</kbd>
|
|
||||||
</Button>
|
|
||||||
<Button variant="ghost" size="icon" className="shrink-0">
|
|
||||||
<MoreVertical className="h-4 w-4" />
|
|
||||||
<span className="sr-only">More options</span>
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user