Commit cb05d629 authored by timel's avatar timel

feat: avatar dropdown

parent f28f8e94
Pipeline #23152 passed with stages
in 10 minutes and 29 seconds
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 {
...@@ -82,15 +82,41 @@ export const Component = () => { ...@@ -82,15 +82,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>
)} )}
...@@ -103,5 +129,7 @@ export const Component = () => { ...@@ -103,5 +129,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