Skip to content

Commit 770307f

Browse files
committed
feat: add about page
1 parent 5796601 commit 770307f

File tree

6 files changed

+413
-96
lines changed

6 files changed

+413
-96
lines changed

web/src/components/layouts/root-layout.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
import { useTranslation } from "react-i18next";
12
import { NavLink } from "react-router";
23
import { Outlet } from "react-router-dom";
34
import { LanguageSwitcher } from "@/components/language-switcher";
45
import { ModeToggle } from "@/components/mode-toggle.tsx";
56
import { ThemeProvider } from "@/components/theme-provider.tsx";
67
import { Button } from "@/components/ui/button";
78
import { Toaster } from "@/components/ui/sonner";
8-
import VersionBadge from "@/components/version-badge";
99
import { GitHubIcon } from "@/icon";
1010
import { siteConfig } from "@/lib/config";
1111
import { MobileNav } from "../modile-nav";
1212

1313
export default function RootLayout() {
14+
const { t } = useTranslation("common");
1415
return (
1516
<ThemeProvider defaultTheme="system" storageKey="vite-ui-theme">
1617
<Toaster />
@@ -19,25 +20,29 @@ export default function RootLayout() {
1920
<div className="flex items-center gap-2">
2021
<MobileNav className="flex lg:hidden" items={siteConfig.navItems} />
2122
<div className="hidden lg:flex">
22-
<NavLink to="/" className="text-base sm:text-lg font-semibold text-center">
23-
MemShellParty
23+
<NavLink
24+
to="/"
25+
className="text-base sm:text-lg font-semibold text-center"
26+
>
27+
{siteConfig.name}
2428
</NavLink>
2529
</div>
2630
<nav className="items-center gap-0.5 hidden lg:flex">
2731
{siteConfig.navItems.map((item) => (
2832
<Button key={item.href} variant="ghost" size="sm" asChild>
29-
<NavLink to={item.href}>{item.label}</NavLink>
33+
<NavLink to={item.href}>{t(item.label)}</NavLink>
3034
</Button>
3135
))}
3236
</nav>
3337
<div className="ml-auto flex items-center gap-2 md:flex-1 md:justify-end">
34-
<VersionBadge />
3538
<LanguageSwitcher />
3639
<Button
3740
variant="ghost"
3841
size="icon"
3942
className="size-8"
40-
onClick={() => window.open("https://github.com/ReaJason/MemShellParty")}
43+
onClick={() =>
44+
window.open("https://github.com/ReaJason/MemShellParty")
45+
}
4146
>
4247
<GitHubIcon />
4348
</Button>

web/src/components/ui/avatar.tsx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import * as React from "react"
2+
import {Avatar as AvatarPrimitive} from "radix-ui"
3+
4+
import { cn } from "@/lib/utils"
5+
6+
function Avatar({
7+
className,
8+
...props
9+
}: React.ComponentProps<typeof AvatarPrimitive.Root>) {
10+
return (
11+
<AvatarPrimitive.Root
12+
data-slot="avatar"
13+
className={cn(
14+
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
15+
className
16+
)}
17+
{...props}
18+
/>
19+
)
20+
}
21+
22+
function AvatarImage({
23+
className,
24+
...props
25+
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
26+
return (
27+
<AvatarPrimitive.Image
28+
data-slot="avatar-image"
29+
className={cn("aspect-square size-full", className)}
30+
{...props}
31+
/>
32+
)
33+
}
34+
35+
function AvatarFallback({
36+
className,
37+
...props
38+
}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
39+
return (
40+
<AvatarPrimitive.Fallback
41+
data-slot="avatar-fallback"
42+
className={cn(
43+
"bg-muted flex size-full items-center justify-center rounded-full",
44+
className
45+
)}
46+
{...props}
47+
/>
48+
)
49+
}
50+
51+
export { Avatar, AvatarImage, AvatarFallback }

web/src/components/version-badge.tsx

Lines changed: 0 additions & 90 deletions
This file was deleted.

web/src/lib/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,9 @@ export const siteConfig = {
1717
href: "/probeshell",
1818
label: "ProbeShellGenerator",
1919
},
20+
{
21+
href: "/about",
22+
label: "about",
23+
},
2024
],
2125
};

0 commit comments

Comments
 (0)