mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-14 02:15:57 +00:00
refactor(ui): replace API Docs sidebar item with Documents header link and remove notification bell
- Remove "API Docs" from sidebar menu - Add external "Documents" link (docs.goclaw.sh) to topbar header - Remove unused notification bell icon from topbar
This commit is contained in:
1 parent
dc7f91b9f6
commit
b9d875472f
5 files changed
+14
-15
No files matched your search
@@ -25,7 +25,6 @@ import {
|
||||
Network,
|
||||
Contact,
|
||||
KeyRound,
|
||||
FileText,
|
||||
Building2,
|
||||
} from "lucide-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -132,7 +131,6 @@ export function Sidebar({ collapsed, onNavItemClick }: SidebarProps) {
|
||||
<SidebarItem to={ROUTES.CONFIG} icon={Settings} label={t("nav.config")} collapsed={collapsed} />
|
||||
)}
|
||||
<SidebarItem to={ROUTES.APPROVALS} icon={ShieldCheck} label={t("nav.approvals")} collapsed={collapsed} />
|
||||
<SidebarItem to="/docs" icon={FileText} label={t("nav.apiDocs")} collapsed={collapsed} external />
|
||||
</SidebarGroup>
|
||||
)}
|
||||
</nav>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Moon, Sun, PanelLeftClose, PanelLeftOpen, Menu, LogOut, Bell, Globe, Clock, Building2, ChevronDown, Check, User, KeyRound } from "lucide-react";
|
||||
import { Moon, Sun, PanelLeftClose, PanelLeftOpen, Menu, LogOut, Globe, Clock, Building2, ChevronDown, Check, User, KeyRound, FileText } from "lucide-react";
|
||||
import { useNavigate } from "react-router";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useUiStore } from "@/stores/use-ui-store";
|
||||
import { useAuthStore } from "@/stores/use-auth-store";
|
||||
import { useTenants } from "@/hooks/use-tenants";
|
||||
import { useIsMobile } from "@/hooks/use-media-query";
|
||||
import { usePendingPairingsCount } from "@/hooks/use-pending-pairings-count";
|
||||
|
||||
import { ROUTES, SUPPORTED_LANGUAGES, LANGUAGE_LABELS, TIMEZONE_OPTIONS, LOCAL_STORAGE_KEYS, type Language } from "@/lib/constants";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { Popover } from "radix-ui";
|
||||
@@ -24,8 +24,6 @@ export function Topbar() {
|
||||
const toggleSidebar = useUiStore((s) => s.toggleSidebar);
|
||||
const setMobileSidebarOpen = useUiStore((s) => s.setMobileSidebarOpen);
|
||||
const isMobile = useIsMobile();
|
||||
const navigate = useNavigate();
|
||||
const { pendingCount } = usePendingPairingsCount({ showToast: true });
|
||||
|
||||
const isDark = theme === "dark" || (theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches);
|
||||
|
||||
@@ -52,16 +50,16 @@ export function Topbar() {
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
<button
|
||||
onClick={() => navigate(ROUTES.NODES)}
|
||||
className="relative cursor-pointer rounded-md p-2 text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
||||
title={pendingCount > 0 ? t("pendingPairing", { count: pendingCount }) : t("pairingRequests")}
|
||||
<a
|
||||
href="https://docs.goclaw.sh"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-1 cursor-pointer rounded-md px-2 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
||||
title={t("documents")}
|
||||
>
|
||||
<Bell className="h-4 w-4" />
|
||||
{pendingCount > 0 && (
|
||||
<span className="absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-destructive" />
|
||||
)}
|
||||
</button>
|
||||
<FileText className="h-4 w-4 shrink-0" />
|
||||
<span className="hidden sm:inline">{t("documents")}</span>
|
||||
</a>
|
||||
|
||||
<Select value={language} onValueChange={(v) => setLanguage(v as Language)}>
|
||||
<SelectTrigger
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
"pendingPairingRequest": "{{count}} pending pairing request",
|
||||
"pendingPairingRequests": "{{count}} pending pairing requests",
|
||||
"apiKeys": "API Keys",
|
||||
"documents": "Documents",
|
||||
"languages": {
|
||||
"en": "English",
|
||||
"vi": "Tiếng Việt",
|
||||
|
||||
@@ -15,5 +15,6 @@
|
||||
"pendingPairingRequest": "{{count}} yêu cầu ghép nối đang chờ",
|
||||
"pendingPairingRequests": "{{count}} yêu cầu ghép nối đang chờ",
|
||||
"apiKeys": "API Keys",
|
||||
"documents": "Tài liệu",
|
||||
"toggleTheme": "Chuyển đổi giao diện"
|
||||
}
|
||||
@@ -15,5 +15,6 @@
|
||||
"pendingPairingRequest": "待处理配对请求",
|
||||
"pendingPairingRequests": "{{count}} 个待处理配对请求",
|
||||
"apiKeys": "API Keys",
|
||||
"documents": "文档",
|
||||
"toggleTheme": "切换主题"
|
||||
}
|
||||
Reference in new issue
Block a user