diff --git a/apps/www/package.json b/apps/www/package.json index 85930c5..8df5147 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -31,6 +31,7 @@ "@radix-ui/react-primitive": "2.0.0", "@radix-ui/react-select": "2.1.2", "@radix-ui/react-switch": "1.1.0", + "@radix-ui/react-tabs": "^1.1.3", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@unocss/eslint-plugin": "^0.61.5", diff --git a/apps/www/src/app/(main)/settings/page.tsx b/apps/www/src/app/(main)/settings/page.tsx new file mode 100644 index 0000000..dbdd48b --- /dev/null +++ b/apps/www/src/app/(main)/settings/page.tsx @@ -0,0 +1,16 @@ +import { Settings } from "@/components/feat/settings/settings"; +import type { Metadata } from "next"; + +export const metadata: Metadata = { + applicationName: "MHSF", + title: "Settings · MHSF", + description: "View settings for MHSF", +}; + +export default function ServerListPage() { + return ( +
+ +
+ ); +} diff --git a/apps/www/src/components/feat/navbar/menu-dropdown.tsx b/apps/www/src/components/feat/navbar/menu-dropdown.tsx index 2f7d083..6c6b471 100644 --- a/apps/www/src/components/feat/navbar/menu-dropdown.tsx +++ b/apps/www/src/components/feat/navbar/menu-dropdown.tsx @@ -1,9 +1,14 @@ +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; import { DropdownMenuItem, DropdownMenuSeparator, } from "@/components/ui/dropdown-menu"; +import Github from "@/components/ui/github"; +import { Link } from "@/components/util/link"; +import { version } from "@/config/version"; import { SignedIn, SignedOut, useClerk } from "@clerk/nextjs"; -import { LogIn, Settings, Ship, User, UserCog } from "lucide-react"; +import { LogIn, LogOut, Settings, Ship, User, UserCog } from "lucide-react"; import { useRouter } from "next/navigation"; export function MenuDropdown() { @@ -51,14 +56,44 @@ export function MenuDropdown() { User Settings + clerk.signOut()}> + + + Sign out + + App - - - - Settings - - + + + + + Settings + + + + +
  • +
    +
    + +
    + + + +
    +
  • ); } diff --git a/apps/www/src/components/feat/navbar/navbar.tsx b/apps/www/src/components/feat/navbar/navbar.tsx index 65c3a71..c65312b 100644 --- a/apps/www/src/components/feat/navbar/navbar.tsx +++ b/apps/www/src/components/feat/navbar/navbar.tsx @@ -14,12 +14,11 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import Github from "@/components/ui/github"; -import { ALegacy } from "@/components/util/link"; +import { Link } from "@/components/util/link"; import { version } from "@/config/version"; import { useScroll } from "@/lib/hooks/use-scroll"; import { cn } from "@/lib/utils"; import { Menu, ServerCrash } from "lucide-react"; -import Link from "next/link"; import { MenuDropdown } from "./menu-dropdown"; export function NavBar() { @@ -47,28 +46,28 @@ export function NavBar() { - + Go home - + - + Open GitHub - - + + Open GitHub Releases - + diff --git a/apps/www/src/components/feat/settings/browser-settings.tsx b/apps/www/src/components/feat/settings/browser-settings.tsx new file mode 100644 index 0000000..6201b43 --- /dev/null +++ b/apps/www/src/components/feat/settings/browser-settings.tsx @@ -0,0 +1,5 @@ +import { Material } from "@/components/ui/material"; + +export function BrowserSettings() { + return ; +} diff --git a/apps/www/src/components/feat/settings/settings.tsx b/apps/www/src/components/feat/settings/settings.tsx new file mode 100644 index 0000000..89c178e --- /dev/null +++ b/apps/www/src/components/feat/settings/settings.tsx @@ -0,0 +1,88 @@ +"use client"; + +import { Button } from "@/components/ui/button"; +import { Material } from "@/components/ui/material"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { cn } from "@/lib/utils"; +import { SignedIn, SignedOut, useClerk } from "@clerk/nextjs"; +import { ExternalLink, Globe, TabletSmartphone } from "lucide-react"; +import { BrowserSettings } from "./browser-settings"; + +export function Settings() { + const clerk = useClerk(); + + return ( +
    +

    + Settings +

    + + + + + Browser stored settings + + + + User stored settings + + + clerk.openUserProfile()} + > + Account Settings + + + + + + + + + +

    + Create an account. +

    + +

    + Creating an account allows you to mark your favorite servers, + link your own servers with your own, link your Minecraft + account to your MHSF one, and store various different settings + to sync across all of the devices linked with your account. +

    +
    + + + + +
    +
    +
    +
    +
    + ); +} diff --git a/apps/www/src/components/ui/badge.tsx b/apps/www/src/components/ui/badge.tsx index 6befb67..78016dd 100644 --- a/apps/www/src/components/ui/badge.tsx +++ b/apps/www/src/components/ui/badge.tsx @@ -54,7 +54,7 @@ export interface BadgeProps function Badge({ className, variant, ...props }: BadgeProps) { return ( -
    + ); } diff --git a/apps/www/src/components/ui/tabs.tsx b/apps/www/src/components/ui/tabs.tsx new file mode 100644 index 0000000..dffca9d --- /dev/null +++ b/apps/www/src/components/ui/tabs.tsx @@ -0,0 +1,61 @@ +"use client"; + +import * as React from "react"; +import * as TabsPrimitive from "@radix-ui/react-tabs"; + +import { cn } from "@/lib/utils"; + +const Tabs = TabsPrimitive.Root; + +const TabsList = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)); +TabsList.displayName = TabsPrimitive.List.displayName; + +const TabsTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + {props.children} +
    + +)); +TabsTrigger.displayName = TabsPrimitive.Trigger.displayName; + +const TabsContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)); +TabsContent.displayName = TabsPrimitive.Content.displayName; + +export { Tabs, TabsList, TabsTrigger, TabsContent }; diff --git a/apps/www/src/components/util/link.tsx b/apps/www/src/components/util/link.tsx index 4a66953..6e8721c 100644 --- a/apps/www/src/components/util/link.tsx +++ b/apps/www/src/components/util/link.tsx @@ -1,84 +1,22 @@ -/* - * 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 { ReactNode } from "react"; -import { default as NextLink } from "next/link"; +import { type LinkProps, default as NextLink } from "next/link"; import { Book, ExternalLink, NotebookText } from "lucide-react"; -export default function A({ - children, - alt, -}: { - children: string; - alt: string | ReactNode; -}) { - return ( - - {(children || "").startsWith("Docs:") && ( - - )} - {(children || "").startsWith("Wiki:") && ( - - )} - {alt} - {(children || "").startsWith("https") && ( - - )} - - ); -} +export function Link( + props: LinkProps & { + children?: React.ReactNode; + } +) { + const href = props.href as string; -export function ALegacy({ - children, - href, -}: { - children?: string | ReactNode; - href?: string; -}) { return ( - + {(href || "").startsWith("Docs:") && ( )} {(href || "").startsWith("Wiki:") && ( )} - {children} + {props.children} {(href || "").startsWith("https") && ( )} diff --git a/apps/www/src/config/version.tsx b/apps/www/src/config/version.tsx index db096ff..9960e31 100644 --- a/apps/www/src/config/version.tsx +++ b/apps/www/src/config/version.tsx @@ -29,10 +29,9 @@ */ "use client"; -import A from "@/components/util/link"; +import { Link } from "@/components/util/link"; import { Button } from "@/components/ui/button"; import Github from "@/components/ui/github"; -import Link from "next/link"; import type { ReactNode } from "react"; const User = ({ user }: { user: string }) => ( @@ -238,9 +237,9 @@ export const changelog: { name: string; id: string; changelog: ReactNode }[] = [
  • • Minor backend changes
  • •{" "} - - Special:GitHub/releases/tag/1.3.2 - + + Please check on GitHub for statuses about this project. +
  • @@ -256,11 +255,11 @@ export const changelog: { name: string; id: string; changelog: ReactNode }[] = [
    • - • Docs:Reading + • New documentation linking
    • • Achievements are here! See more at{" "} - Docs:Advanced/Achievements + here
    • • Finally fixed Cron actions for the final time™
    • • Overhauled account preferences
    • diff --git a/yarn.lock b/yarn.lock index b85527c..500da7c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2315,7 +2315,7 @@ "@radix-ui/react-use-previous" "1.1.0" "@radix-ui/react-use-size" "1.1.0" -"@radix-ui/react-tabs@^1.1.0": +"@radix-ui/react-tabs@^1.1.0", "@radix-ui/react-tabs@^1.1.3": version "1.1.3" resolved "https://registry.yarnpkg.com/@radix-ui/react-tabs/-/react-tabs-1.1.3.tgz#c47c8202dc676dea47676215863d2ef9b141c17a" integrity sha512-9mFyI30cuRDImbmFF6O2KUJdgEOsGh9Vmx9x/Dh9tOhL7BngmQPQfwW4aejKm5OHpfWIdmeV6ySyuxoOGjtNng==