mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-14 04:16:06 +00:00
fix(ui): correct license to CC BY-NC 4.0 and move About to header
- Fix hardcoded MIT license → CC BY-NC 4.0 with link to CC website - Move About button from user menu dropdown to topbar header - Shorten menu label to "About" / "Giới thiệu" / "关于"
This commit is contained in:
1 parent
a550a13766
commit
fe26f2d3e0
5 files changed
+21
-24
No files matched your search
@@ -96,7 +96,14 @@ export function AboutDialog({ open, onOpenChange }: AboutDialogProps) {
|
||||
{/* License */}
|
||||
<div className="grid grid-cols-[140px_1fr] items-baseline gap-2 text-sm">
|
||||
<span className="text-muted-foreground">{t("about.license")}</span>
|
||||
<span className="font-medium">MIT</span>
|
||||
<a
|
||||
href="https://creativecommons.org/licenses/by-nc/4.0/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-primary hover:underline"
|
||||
>
|
||||
CC BY-NC 4.0
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{/* Documentation */}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Moon, Sun, PanelLeftClose, PanelLeftOpen, Menu, LogOut, Globe, Clock, Building2, ChevronDown, Check, User, KeyRound, FileText, Info } from "lucide-react";
|
||||
import { Moon, Sun, PanelLeftClose, PanelLeftOpen, Menu, LogOut, Globe, Clock, Building2, ChevronDown, Check, User, KeyRound, Info } from "lucide-react";
|
||||
import { useNavigate } from "react-router";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useUiStore } from "@/stores/use-ui-store";
|
||||
@@ -25,6 +25,7 @@ export function Topbar() {
|
||||
const toggleSidebar = useUiStore((s) => s.toggleSidebar);
|
||||
const setMobileSidebarOpen = useUiStore((s) => s.setMobileSidebarOpen);
|
||||
const isMobile = useIsMobile();
|
||||
const [showAbout, setShowAbout] = useState(false);
|
||||
|
||||
const isDark = theme === "dark" || (theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches);
|
||||
|
||||
@@ -51,16 +52,14 @@ export function Topbar() {
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
<a
|
||||
href="https://docs.goclaw.sh"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
<button
|
||||
onClick={() => setShowAbout(true)}
|
||||
className="flex items-center gap-1 cursor-pointer rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
||||
title={t("documents")}
|
||||
title={t("about.menuItem")}
|
||||
>
|
||||
<FileText className="h-4 w-4 shrink-0" />
|
||||
<span className="hidden sm:inline">{t("documents")}</span>
|
||||
</a>
|
||||
<Info className="h-4 w-4 shrink-0" />
|
||||
<span className="hidden sm:inline">{t("about.menuItem")}</span>
|
||||
</button>
|
||||
|
||||
<Select value={language} onValueChange={(v) => setLanguage(v as Language)}>
|
||||
<SelectTrigger
|
||||
@@ -102,6 +101,8 @@ export function Topbar() {
|
||||
|
||||
<UserMenu />
|
||||
</div>
|
||||
|
||||
<AboutDialog open={showAbout} onOpenChange={setShowAbout} />
|
||||
</header>
|
||||
);
|
||||
}
|
||||
@@ -114,7 +115,6 @@ function UserMenu() {
|
||||
const { currentTenant, currentTenantName, tenants, isCrossTenant, isMultiTenant, currentTenantId } = useTenants();
|
||||
const [open, setOpen] = useState(false);
|
||||
const [showLogoutConfirm, setShowLogoutConfirm] = useState(false);
|
||||
const [showAbout, setShowAbout] = useState(false);
|
||||
const navigate = useNavigate();
|
||||
|
||||
const tenantLabel = currentTenant?.name || currentTenantName || "";
|
||||
@@ -206,15 +206,6 @@ function UserMenu() {
|
||||
<span>{t("apiKeys")}</span>
|
||||
</button>
|
||||
|
||||
{/* About */}
|
||||
<button
|
||||
onClick={() => { setOpen(false); setShowAbout(true); }}
|
||||
className="flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent"
|
||||
>
|
||||
<Info className="h-3.5 w-3.5 shrink-0" />
|
||||
<span>{t("about.menuItem")}</span>
|
||||
</button>
|
||||
|
||||
<div className="my-1 border-t" />
|
||||
|
||||
{/* Logout */}
|
||||
@@ -239,7 +230,6 @@ function UserMenu() {
|
||||
onConfirm={() => { setShowLogoutConfirm(false); logout(); }}
|
||||
/>
|
||||
|
||||
<AboutDialog open={showAbout} onOpenChange={setShowAbout} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
"apiKeys": "API Keys",
|
||||
"documents": "Documents",
|
||||
"about": {
|
||||
"menuItem": "About GoClaw",
|
||||
"menuItem": "About",
|
||||
"title": "About GoClaw",
|
||||
"version": "Version",
|
||||
"sourceCode": "Source Code",
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"apiKeys": "API Keys",
|
||||
"documents": "Tài liệu",
|
||||
"about": {
|
||||
"menuItem": "Giới thiệu GoClaw",
|
||||
"menuItem": "Giới thiệu",
|
||||
"title": "Giới thiệu GoClaw",
|
||||
"version": "Phiên bản",
|
||||
"sourceCode": "Mã nguồn",
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"apiKeys": "API Keys",
|
||||
"documents": "文档",
|
||||
"about": {
|
||||
"menuItem": "关于 GoClaw",
|
||||
"menuItem": "关于",
|
||||
"title": "关于 GoClaw",
|
||||
"version": "版本",
|
||||
"sourceCode": "源代码",
|
||||
|
||||
Reference in new issue
Block a user