Commit 8df81c2f authored by timel's avatar timel

Merge branch 'feat/avatar-dropdown' into 'main'

feat: avatar dropdown

See merge request !267
parents d7fab496 cb05d629
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" }} />
);
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment