feat: update footer

This commit is contained in:
Maël Gangloff
2024-08-04 01:32:58 +02:00
parent 4765445921
commit 95fc5c7d33
3 changed files with 120 additions and 152 deletions

View File

@@ -1,4 +1,4 @@
import {Layout, theme} from "antd";
import {Button, Layout, Space, theme} from "antd";
import {Link, Navigate, Route, Routes, useLocation, useNavigate} from "react-router-dom";
import TextPage from "./pages/TextPage";
import DomainSearchPage from "./pages/search/DomainSearchPage";
@@ -15,6 +15,7 @@ import ConnectorsPage from "./pages/tracking/ConnectorsPage";
import NotFoundPage from "./pages/NotFoundPage";
import useBreakpoint from "./hooks/useBreakpoint";
import {Sider} from "./components/Sider";
import {t} from "ttag";
export default function App() {
const {
@@ -92,8 +93,14 @@ export default function App() {
</div>
</Layout.Content>
<Layout.Footer style={{textAlign: 'center'}}>
<Space size='middle'>
<Link to='/tos'><Button type='text'>{t`Terms of service`}</Button></Link>
<Link to='/privacy'><Button type='text'>{t`Privacy Policy`}</Button></Link>
<Link to='/faq'><Button type='text'>{t`FAQ`}</Button></Link>
</Space>
<br/><br/>
<Link to='https://github.com/maelgangloff/domain-watchdog'>Domain
Watchdog</Link> &copy; {new Date().getFullYear()} Maël Gangloff
Watchdog</Link> is an open source project distributed under AGPL-3.0-or-later license.
</Layout.Footer>
</Layout>
</Layout>

View File

@@ -5,14 +5,11 @@ import {
BankOutlined,
CloudServerOutlined,
CompassOutlined,
FileProtectOutlined,
FileSearchOutlined,
HomeOutlined,
InfoCircleOutlined,
LineChartOutlined,
LoginOutlined,
LogoutOutlined,
QuestionCircleOutlined,
SearchOutlined,
TeamOutlined,
UserOutlined
@@ -45,6 +42,14 @@ export function Sider({isAuthenticated}: { isAuthenticated: boolean }) {
disabled: !isAuthenticated,
onClick: () => navigate('/search/domain')
},
{
key: 'tld-list',
icon: <BankOutlined/>,
label: t`TLD`,
title: t`TLD list`,
disabled: !isAuthenticated,
onClick: () => navigate('/info/tld')
},
{
key: 'entity-finder',
icon: <TeamOutlined/>,
@@ -63,28 +68,6 @@ export function Sider({isAuthenticated}: { isAuthenticated: boolean }) {
}
]
},
{
key: 'info',
label: t`Information`,
icon: <InfoCircleOutlined/>,
children: [
{
key: 'tld-list',
icon: <BankOutlined/>,
label: t`TLD`,
title: t`TLD list`,
disabled: !isAuthenticated,
onClick: () => navigate('/info/tld')
},
{
key: 'stats',
icon: <LineChartOutlined/>,
label: t`Statistics`,
disabled: true,
onClick: () => navigate('/info/stats')
}
]
},
{
key: 'tracking',
label: t`Tracking`,
@@ -107,57 +90,43 @@ export function Sider({isAuthenticated}: { isAuthenticated: boolean }) {
]
},
{
key: 'watchdog',
label: t`My Watchdog`,
icon: <UserOutlined/>,
children: [
{
key: 'account',
icon: <UserOutlined/>,
label: t`My Account`,
disabled: !isAuthenticated,
onClick: () => navigate('/user')
},
{
key: 'tos',
icon: <InfoCircleOutlined/>,
label: t`TOS`,
onClick: () => navigate('/tos')
},
{
key: 'privacy',
icon: <FileProtectOutlined/>,
label: t`Privacy Policy`,
onClick: () => navigate('/privacy')
}
]
},
{
key: '5',
icon: <QuestionCircleOutlined/>,
label: t`FAQ`,
onClick: () => navigate('/faq')
},
key: 'stats',
icon: <LineChartOutlined/>,
label: t`Statistics`,
disabled: true,
onClick: () => navigate('/info/stats')
}
]
return <Menu
defaultSelectedKeys={['home']}
defaultOpenKeys={['search', 'info', 'tracking', 'watchdog']}
mode="inline"
theme="dark"
items={[...menuItems, isAuthenticated ? {
key: '8',
if (isAuthenticated) {
menuItems.push(...[{
key: 'account',
icon: <UserOutlined/>,
label: t`My Account`,
disabled: !isAuthenticated,
onClick: () => navigate('/user')
}, {
key: 'logout',
icon: <LogoutOutlined/>,
label: t`Log out`,
danger: true,
onClick: () => window.location.replace("/logout")
} : {
key: '8',
}])
} else {
menuItems.push({
key: 'login',
icon: <LoginOutlined/>,
label: t`Log in`,
onClick: () => navigate('/login')
}]}
})
}
return <Menu
defaultSelectedKeys={['home']}
defaultOpenKeys={['search', 'info', 'tracking', 'doc']}
mode="inline"
theme="dark"
items={menuItems}
/>
}