news & things

This commit is contained in:
2024-04-13 14:37:30 +03:00
parent 8904d3c2b6
commit 89f59dabb1
17 changed files with 334 additions and 5 deletions

View File

@ -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"