Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baichixing
Neos
Commits
cb05d629
Commit
cb05d629
authored
Aug 16, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: avatar dropdown
parent
f28f8e94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
11 deletions
+39
-11
src/ui/Layout/index.tsx
src/ui/Layout/index.tsx
+39
-11
No files found.
src/ui/Layout/index.tsx
View file @
cb05d629
import
{
Avatar
}
from
"
antd
"
;
import
{
Avatar
,
Dropdown
}
from
"
antd
"
;
import
classNames
from
"
classnames
"
;
import
React
,
{
useEffect
}
from
"
react
"
;
import
{
...
...
@@ -82,15 +82,41 @@ export const Component = () => {
</
HeaderBtn
>
<
span
style=
{
{
flexGrow
:
1
}
}
/>
<
span
className=
{
styles
.
profile
}
>
<
NeosAvatar
/>
{
/*暂时跳转到萌卡的profile页面*/
}
<
HeaderBtn
to=
{
NeosConfig
.
profileUrl
}
disabled=
{
!
logined
}
>
个人中心
</
HeaderBtn
>
<
HeaderBtn
to=
"https://ygobbs.com"
>
萌卡社区
</
HeaderBtn
>
<
HeaderBtn
to=
"https://mycard.moe/ygopro/arena/#/"
>
决斗数据库
</
HeaderBtn
>
<
Dropdown
arrow
menu=
{
{
items
:
[
{
label
:
(
<
a
href=
{
NeosConfig
.
profileUrl
}
target=
"_blank"
>
个人中心
</
a
>
),
},
{
label
:
(
<
a
href=
"https://ygobbs.com"
target=
"_blank"
>
萌卡社区
</
a
>
),
},
{
label
:
(
<
a
href=
"https://mycard.moe/ygopro/arena/#/"
target=
"_blank"
>
决斗数据库
</
a
>
),
},
].
map
((
x
,
key
)
=>
({
...
x
,
key
})),
}
}
>
<
div
>
<
NeosAvatar
/>
</
div
>
</
Dropdown
>
</
span
>
</
nav
>
)
}
...
...
@@ -103,5 +129,7 @@ export const Component = () => {
const
NeosAvatar
=
()
=>
{
const
{
user
}
=
useSnapshot
(
accountStore
);
return
<
Avatar
size=
"small"
src=
{
user
?.
avatar_url
}
/>;
return
(
<
Avatar
size=
"small"
src=
{
user
?.
avatar_url
}
style=
{
{
cursor
:
"
pointer
"
}
}
/>
);
};
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