Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ee3d6d8e
authored
May 18, 2025
by
Apple\Apple
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat(ui): Add a dropdown menu item for the user avatar in the HeaderBar
parent
63e149b1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
1 deletions
+44
-1
web/src/components/HeaderBar.js
+44
-1
No files found.
web/src/components/HeaderBar.js
View file @
ee3d6d8e
...
...
@@ -14,6 +14,10 @@ import {
IconChevronDown
,
IconSun
,
IconMoon
,
IconExit
,
IconUserSetting
,
IconCreditCard
,
IconKey
,
}
from
'@douyinfe/semi-icons'
;
import
{
Avatar
,
...
...
@@ -210,8 +214,47 @@ const HeaderBar = () => {
position
=
"bottomRight"
render
=
{
<
Dropdown
.
Menu
className
=
"!bg-semi-color-bg-overlay !border-semi-color-border !shadow-lg !rounded-lg dark:!bg-gray-700 dark:!border-gray-600"
>
<
Dropdown
.
Item
onClick
=
{()
=>
{
navigate
(
'/personal'
);
setMobileMenuOpen
(
false
);
}}
className
=
"!px-3 !py-1.5 !text-sm !text-semi-color-text-0 hover:!bg-semi-color-fill-1 dark:!text-gray-200 dark:hover:!bg-blue-500 dark:hover:!text-white"
>
<
div
className
=
"flex items-center gap-2"
>
<
IconUserSetting
size
=
"small"
className
=
"text-gray-500 dark:text-gray-400"
/>
<
span
>
{
t
(
'个人设置'
)}
<
/span
>
<
/div
>
<
/Dropdown.Item
>
<
Dropdown
.
Item
onClick
=
{()
=>
{
navigate
(
'/token'
);
setMobileMenuOpen
(
false
);
}}
className
=
"!px-3 !py-1.5 !text-sm !text-semi-color-text-0 hover:!bg-semi-color-fill-1 dark:!text-gray-200 dark:hover:!bg-blue-500 dark:hover:!text-white"
>
<
div
className
=
"flex items-center gap-2"
>
<
IconKey
size
=
"small"
className
=
"text-gray-500 dark:text-gray-400"
/>
<
span
>
{
t
(
'API令牌'
)}
<
/span
>
<
/div
>
<
/Dropdown.Item
>
<
Dropdown
.
Item
onClick
=
{()
=>
{
navigate
(
'/topup'
);
setMobileMenuOpen
(
false
);
}}
className
=
"!px-3 !py-1.5 !text-sm !text-semi-color-text-0 hover:!bg-semi-color-fill-1 dark:!text-gray-200 dark:hover:!bg-blue-500 dark:hover:!text-white"
>
<
div
className
=
"flex items-center gap-2"
>
<
IconCreditCard
size
=
"small"
className
=
"text-gray-500 dark:text-gray-400"
/>
<
span
>
{
t
(
'钱包'
)}
<
/span
>
<
/div
>
<
/Dropdown.Item
>
<
Dropdown
.
Item
onClick
=
{
logout
}
className
=
"!px-3 !py-1.5 !text-sm !text-semi-color-text-0 hover:!bg-semi-color-fill-1 dark:!text-gray-200 dark:hover:!bg-red-500 dark:hover:!text-white"
>
{
t
(
'退出'
)}
<
div
className
=
"flex items-center gap-2"
>
<
IconExit
size
=
"small"
className
=
"text-gray-500 dark:text-gray-400"
/>
<
span
>
{
t
(
'退出'
)}
<
/span
>
<
/div
>
<
/Dropdown.Item
>
<
/Dropdown.Menu
>
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment