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
love_飞影
Neos
Commits
8df81c2f
Commit
8df81c2f
authored
Aug 16, 2023
by
timel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/avatar-dropdown' into 'main'
feat: avatar dropdown See merge request
!267
parents
d7fab496
cb05d629
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 @
8df81c2f
import
{
Avatar
}
from
"
antd
"
;
import
{
Avatar
,
Dropdown
}
from
"
antd
"
;
import
classNames
from
"
classnames
"
;
import
classNames
from
"
classnames
"
;
import
React
,
{
useEffect
}
from
"
react
"
;
import
React
,
{
useEffect
}
from
"
react
"
;
import
{
import
{
...
@@ -84,15 +84,41 @@ export const Component = () => {
...
@@ -84,15 +84,41 @@ export const Component = () => {
</
HeaderBtn
>
</
HeaderBtn
>
<
span
style=
{
{
flexGrow
:
1
}
}
/>
<
span
style=
{
{
flexGrow
:
1
}
}
/>
<
span
className=
{
styles
.
profile
}
>
<
span
className=
{
styles
.
profile
}
>
<
NeosAvatar
/>
<
Dropdown
{
/*暂时跳转到萌卡的profile页面*/
}
arrow
<
HeaderBtn
to=
{
NeosConfig
.
profileUrl
}
disabled=
{
!
logined
}
>
menu=
{
{
个人中心
items
:
[
</
HeaderBtn
>
{
<
HeaderBtn
to=
"https://ygobbs.com"
>
萌卡社区
</
HeaderBtn
>
label
:
(
<
HeaderBtn
to=
"https://mycard.moe/ygopro/arena/#/"
>
<
a
href=
{
NeosConfig
.
profileUrl
}
target=
"_blank"
>
决斗数据库
个人中心
</
HeaderBtn
>
</
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
>
</
span
>
</
nav
>
</
nav
>
)
}
)
}
...
@@ -105,5 +131,7 @@ export const Component = () => {
...
@@ -105,5 +131,7 @@ export const Component = () => {
const
NeosAvatar
=
()
=>
{
const
NeosAvatar
=
()
=>
{
const
{
user
}
=
useSnapshot
(
accountStore
);
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