Skip to content

Commit

Permalink
- added sitemap page
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvink96 committed Oct 3, 2023
1 parent 1184445 commit 4391d8b
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 16 deletions.
35 changes: 35 additions & 0 deletions src/components/SitemapCard/SitemapCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import {Button, CardProps, List} from "antd";
import {Card} from "../index.ts";

import "./styles.css"

type Props = {
data: {
title: string,
links: { title: string, path: string }[]
}
} & CardProps

const SitemapCard = ({data, ...others}: Props) => {
return (
<Card title={data.title} className="sitemap-card card" {...others}>
<List
dataSource={data.links}
bordered={false}
renderItem={(item) => (
<List.Item key={`sitemap-${item.title}`}>
<Button
type="link"
href={item.path}
style={{textTransform: "capitalize", marginLeft: ".5rem"}}
>
{item.title}
</Button>
</List.Item>
)}
/>
</Card>
);
};

export default SitemapCard;
7 changes: 7 additions & 0 deletions src/components/SitemapCard/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.sitemap-card .ant-card-body {
padding: 0;
}

.sitemap-card .ant-list-item {
text-transform: capitalize;
}
12 changes: 7 additions & 5 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ import PageHeader from "./PageHeader/PageHeader.tsx";
import {Bar, Container, Nprogress} from "./Nprogress"
import EmployeeCard from "./EmployeeCard/EmployeeCard";
import BlogsListCard from "./corporate/BlogsListCard/BlogsListCard";
import SocialMediaCard from "./SocialMediaCard/SocialMediaCard.tsx";
import FaqCollapse from "./FaqCollapse/FaqCollapse.tsx";
import ContactForm from "./ContactForm/ContactForm.tsx";
import PricingTable from "./PricingTable/PricingTable.tsx";
import SocialMediaCard from "./SocialMediaCard/SocialMediaCard";
import FaqCollapse from "./FaqCollapse/FaqCollapse";
import ContactForm from "./ContactForm/ContactForm";
import PricingTable from "./PricingTable/PricingTable";
import SitemapCard from "./SitemapCard/SitemapCard";

export {
Logo,
Expand Down Expand Up @@ -127,5 +128,6 @@ export {
SocialMediaCard,
FaqCollapse,
ContactForm,
PricingTable
PricingTable,
SitemapCard
}
4 changes: 3 additions & 1 deletion src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import {
PATH_SUBSCRIPTION,
PATH_USER_MGMT,
PATH_USER_PROFILE,
PATH_LANDING
PATH_LANDING,
PATH_SITEMAP
} from "./routes.ts"

const DASHBOARD_ITEMS = [
Expand Down Expand Up @@ -68,6 +69,7 @@ export {
PATH_SOCIAL,
PATH_START,
PATH_LANDING,
PATH_SITEMAP,
DASHBOARD_ITEMS,
CORPORATE_ITEMS
}
6 changes: 5 additions & 1 deletion src/constants/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ function path(root: string, sublink: string) {

const ROOTS_LANDING = '/home'
const ROOTS_DASHBOARD = '/dashboards'
const ROOTS_SITEMAP = '/sitemap'
const ROOTS_LAYOUT = '/layouts'
const ROOTS_CORPORATE = '/corporate'
const ROOTS_PROFILE = '/profile'
Expand Down Expand Up @@ -42,6 +43,10 @@ export const PATH_DASHBOARD = {
logistics: path(ROOTS_DASHBOARD, '/logistics'),
}

export const PATH_SITEMAP = {
root: ROOTS_SITEMAP
}

export const PATH_LAYOUT = {
root: ROOTS_LAYOUT,
sidebar: {
Expand All @@ -64,7 +69,6 @@ export const PATH_CORPORATE = {
contact: path(ROOTS_CORPORATE, '/contact'),
pricing: path(ROOTS_CORPORATE, '/pricing'),
license: path(ROOTS_CORPORATE, '/license'),
sitemap: path(ROOTS_CORPORATE, '/sitemap'),
}

export const PATH_USER_PROFILE = {
Expand Down
5 changes: 4 additions & 1 deletion src/layouts/app/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {useRef} from "react";
import {ConfigProvider, Layout, Menu, MenuProps, SiderProps} from "antd";
import {
BookOutlined,
BranchesOutlined,
BugOutlined,
CalendarOutlined,
ContactsOutlined,
Expand Down Expand Up @@ -36,6 +37,7 @@ import {
PATH_INVOICE,
PATH_LANDING,
PATH_PROJECTS,
PATH_SITEMAP,
PATH_SOCIAL,
PATH_SUBSCRIPTION,
PATH_USER_MGMT,
Expand Down Expand Up @@ -70,6 +72,8 @@ const items: MenuProps['items'] = [
getItem(<Link to={PATH_DASHBOARD.logistics}>Logistics</Link>, 'logistics', null),
]),

getItem(<Link to={PATH_SITEMAP.root}>Sitemap</Link>, 'sitemap', <BranchesOutlined/>),

getItem(
'Pages',
'pages',
Expand All @@ -84,7 +88,6 @@ const items: MenuProps['items'] = [
getItem(<Link to={PATH_CORPORATE.contact}>Contact us</Link>, 'contact us', null),
getItem(<Link to={PATH_CORPORATE.pricing}>Pricing</Link>, 'pricing', null),
getItem(<Link to={PATH_CORPORATE.license}>License</Link>, 'license', null),
getItem(<Link to={PATH_CORPORATE.sitemap}>Sitemap</Link>, 'sitemap', null),
]),

getItem('User profile', 'user profile', <UserOutlined/>, [
Expand Down
38 changes: 38 additions & 0 deletions src/pages/Sitemap.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import {SitemapCard} from "../components";
import {Col, Row, RowProps, Typography} from "antd";
import {CORPORATE_ITEMS, DASHBOARD_ITEMS} from "../constants";

const ROW_PROPS: RowProps = {
gutter: [
{xs: 8, sm: 16, md: 24, lg: 32},
{xs: 8, sm: 16, md: 24, lg: 32}
]
}

const SITES = [
{
title: "dashboard",
links: DASHBOARD_ITEMS
},
{
title: "corporate",
links: CORPORATE_ITEMS
}
]

const SitemapPage = () => {
return (
<div>
<Typography.Title level={3}>Sitemap</Typography.Title>
<Row {...ROW_PROPS}>
{SITES.map(s =>
<Col xs={24} sm={12} lg={6} xl={6}>
<SitemapCard data={s}/>
</Col>
)}
</Row>
</div>
);
};

export default SitemapPage;
16 changes: 9 additions & 7 deletions src/pages/index.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import {
BiddingDashboardPage,
DefaultDashboardPage,
ProjectsDashboardPage,
EcommerceDashboardPage,
MarketingDashboardPage,
SocialDashboardPage,
BiddingDashboardPage
ProjectsDashboardPage,
SocialDashboardPage
} from "./dashboards"
import HomePage from "./Home.tsx";
import {
CorporateAboutPage,
CorporateTeamPage,
CorporateFaqPage,
CorporateContactPage,
CorporateFaqPage,
CorporateLicensePage,
CorporatePricingPage,
CorporateLicensePage
CorporateTeamPage,
} from "./corporate"
import SitemapPage from "./Sitemap.tsx";

export {
DefaultDashboardPage,
Expand All @@ -29,5 +30,6 @@ export {
CorporateFaqPage,
CorporateContactPage,
CorporatePricingPage,
CorporateLicensePage
CorporateLicensePage,
SitemapPage
}
16 changes: 15 additions & 1 deletion src/routes/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ import {
BiddingDashboardPage,
CorporateAboutPage,
CorporateContactPage,
CorporateFaqPage, CorporateLicensePage,
CorporateFaqPage,
CorporateLicensePage,
CorporatePricingPage,
CorporateTeamPage,
DefaultDashboardPage,
EcommerceDashboardPage,
HomePage,
MarketingDashboardPage,
ProjectsDashboardPage,
SitemapPage,
SocialDashboardPage
} from "../pages";
import ErrorPage from "../pages/errors/Error.tsx";
Expand Down Expand Up @@ -99,6 +101,18 @@ const router = createBrowserRouter([
}
]
},
{
path: "/sitemap",
element: <PageWrapper children={<DashboardLayout/>}/>,
errorElement: <ErrorPage/>,
children: [
{
index: true,
path: "",
element: <SitemapPage/>
}
]
},
{
path: "/corporate",
element: <PageWrapper children={<CorporateLayout/>}/>,
Expand Down

0 comments on commit 4391d8b

Please sign in to comment.