feat(i18n): update AppSidebar component for internationalization support

chore(site): add siteConfig
This commit is contained in:
ngc2207 2024-12-12 21:32:06 +08:00
parent ae662bff78
commit b6a4c3182e
4 changed files with 141 additions and 125 deletions

View File

@ -18,6 +18,10 @@
"shareProject": "Share Project",
"deleteProject": "Delete Project",
"more": "More"
},
"NavSecondary": {
"support": "Support",
"feedback": "Feedback"
}
}
}

View File

@ -18,6 +18,10 @@
"shareProject": "分享项目",
"deleteProject": "删除项目",
"more": "更多"
},
"NavSecondary": {
"support": "支持",
"feedback": "反馈"
}
}
}

View File

@ -22,12 +22,17 @@ import {
SidebarMenuButton,
SidebarMenuItem,
} from "@/components/ui/sidebar";
import { siteConfig } from "@/config/site";
import { useTranslations } from "next-intl";
import { NavMain } from "@/components/nav-main";
import { NavUser } from "@/components/nav-user";
import { NavProjects } from "@/components/nav-projects";
import { NavSecondary } from "@/components/nav-secondary";
const data = {
export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
const t = useTranslations();
const data = {
user: {
name: "gitea",
email: "about@gitea.com",
@ -122,13 +127,13 @@ const data = {
],
navSecondary: [
{
title: "Support",
url: "#",
title: t("Components.NavSecondary.support"),
url: siteConfig.url,
icon: LifeBuoy,
},
{
title: "Feedback",
url: "#",
title: t("Components.NavSecondary.feedback"),
url: siteConfig.url,
icon: Send,
},
],
@ -149,9 +154,8 @@ const data = {
icon: Map,
},
],
};
};
export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
return (
<Sidebar variant="inset" {...props}>
<SidebarHeader>

View File

@ -1,4 +1,8 @@
export const siteConfig = {
url: "https://github.com/NGC2207/judge4c",
};
export const META_THEME_COLORS = {
light: "#ffffff",
dark: "#09090b",
}
};