feat: menu add back to home item (#89)

* feat: menu add back to home item

* chore: auto-fix linting and formatting issues

---------

Co-authored-by: hamster1963 <hamster1963@users.noreply.github.com>
This commit is contained in:
仓鼠
2025-01-04 18:42:58 +08:00
committed by GitHub
parent f93d266810
commit 231f483876
4 changed files with 16 additions and 1 deletions

View File

@@ -20,7 +20,7 @@ import { useMainStore } from "@/hooks/useMainStore"
import { useMediaQuery } from "@/hooks/useMediaQuery"
import { cn } from "@/lib/utils"
import i18next from "i18next"
import { LogOut, Settings, User2 } from "lucide-react"
import { HomeIcon, LogOut, Settings, User2 } from "lucide-react"
import { DateTime } from "luxon"
import { useEffect, useRef, useState } from "react"
import { useTranslation } from "react-i18next"
@@ -147,6 +147,18 @@ export default function Header() {
</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />
<DropdownMenuItem
onClick={() => {
setDropdownOpen(false)
navigate("/")
}}
className="cursor-pointer"
>
<div className="flex items-center gap-2 w-full">
<HomeIcon />
{t("BackToHome")}
</div>
</DropdownMenuItem>
<DropdownMenuItem
onClick={logout}
className="cursor-pointer"

View File

@@ -33,6 +33,7 @@
"Group": "Group",
"Profile": "Profile",
"Settings": "System settings",
"BackToHome": "Back to Home",
"Logout": "Log out",
"NavigateTo": "Navigate to",
"SelectAPageToNavigateTo": "Choose a page to jump to",

View File

@@ -33,6 +33,7 @@
"Group": "分组",
"Profile": "个人信息",
"Settings": "系统设置",
"BackToHome": "返回前台",
"Logout": "登出",
"NavigateTo": "导航至",
"SelectAPageToNavigateTo": "选择一个页面跳转",

View File

@@ -33,6 +33,7 @@
"Group": "分組",
"Profile": "個人資訊",
"Settings": "系統設定",
"BackToHome": "返回前台",
"Logout": "登出",
"NavigateTo": "導航至",
"SelectAPageToNavigateTo": "選擇一個頁面跳轉",