news & things
This commit is contained in:
@ -3,6 +3,7 @@ import {
|
||||
GlobalOutlined,
|
||||
LogoutOutlined,
|
||||
MenuOutlined,
|
||||
PicCenterOutlined,
|
||||
SettingOutlined,
|
||||
UserOutlined,
|
||||
} from "@ant-design/icons";
|
||||
@ -100,6 +101,11 @@ const HeaderComponent = () => {
|
||||
icon: <DesktopOutlined />,
|
||||
disabled: !user,
|
||||
},
|
||||
{
|
||||
label: <Link to="/news">{tr("News")}</Link>,
|
||||
key: "news",
|
||||
icon: <PicCenterOutlined />,
|
||||
},
|
||||
{
|
||||
label: tr("Language"),
|
||||
key: "language",
|
||||
@ -111,7 +117,7 @@ const HeaderComponent = () => {
|
||||
label: user ? user.username : tr("Log in"),
|
||||
key: "login",
|
||||
icon: <UserOutlined />,
|
||||
onClick: () => setAuthModalOpen(true),
|
||||
onClick: () => !user && setAuthModalOpen(true),
|
||||
...(user ? { children: userMenuItems } : {}),
|
||||
},
|
||||
];
|
||||
@ -139,6 +145,13 @@ const HeaderComponent = () => {
|
||||
key: "dashboard",
|
||||
icon: <DesktopOutlined />,
|
||||
disabled: !user,
|
||||
onClick: () => setDrawerOpen(false),
|
||||
},
|
||||
{
|
||||
label: <Link to="/news">{tr("News")}</Link>,
|
||||
key: "news",
|
||||
icon: <PicCenterOutlined />,
|
||||
onClick: () => setDrawerOpen(false),
|
||||
},
|
||||
{
|
||||
label: tr("Language"),
|
||||
@ -151,14 +164,18 @@ const HeaderComponent = () => {
|
||||
label: user ? user.username : tr("Log in"),
|
||||
key: "login",
|
||||
icon: <UserOutlined />,
|
||||
onClick: () => setAuthModalOpen(true),
|
||||
onClick: () => !user && setAuthModalOpen(true),
|
||||
...(user ? { children: userMenuItems } : {}),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<AuthModal open={authModalOpen} setOpen={setAuthModalOpen} />
|
||||
<AuthModal
|
||||
open={authModalOpen}
|
||||
setOpen={setAuthModalOpen}
|
||||
setDrawerOpen={setDrawerOpen}
|
||||
/>
|
||||
<Header className="header">
|
||||
<Menu
|
||||
theme="dark"
|
||||
|
||||
Reference in New Issue
Block a user