From 879ad614b26ba4698019df207ba1d1eaed38879b Mon Sep 17 00:00:00 2001 From: Kelvin Kiptum Kiprop Date: Sun, 15 Oct 2023 23:32:41 +0300 Subject: [PATCH 1/4] - added user profiles to sitemap - updated sitemap card --- src/App.css | 2 +- src/components/SitemapCard/SitemapCard.tsx | 29 +++++++------- src/layouts/userAccount/index.tsx | 45 ++++++++++++++++++++-- src/pages/Sitemap.tsx | 36 +++++++++-------- 4 files changed, 77 insertions(+), 35 deletions(-) diff --git a/src/App.css b/src/App.css index 7e7d1f0..c51b8d3 100644 --- a/src/App.css +++ b/src/App.css @@ -17,7 +17,7 @@ .page-enter-active, .page-exit-active { - transition: opacity 300ms; + transition: opacity 200ms; } .fade-enter-active, diff --git a/src/components/SitemapCard/SitemapCard.tsx b/src/components/SitemapCard/SitemapCard.tsx index 7370b14..cfb4c41 100644 --- a/src/components/SitemapCard/SitemapCard.tsx +++ b/src/components/SitemapCard/SitemapCard.tsx @@ -1,4 +1,4 @@ -import {Button, CardProps, List} from "antd"; +import {Button, CardProps, Flex, Typography} from "antd"; import {Card} from "../index.ts"; import "./styles.css" @@ -12,22 +12,23 @@ type Props = { const SitemapCard = ({data, ...others}: Props) => { return ( - - ( - + + + + {data.title} + + + {data.links.map(d => - - )} - /> + {d.title} + )} + + ); }; diff --git a/src/layouts/userAccount/index.tsx b/src/layouts/userAccount/index.tsx index aa66f9c..eabd86c 100644 --- a/src/layouts/userAccount/index.tsx +++ b/src/layouts/userAccount/index.tsx @@ -1,13 +1,25 @@ import {AppLayout} from "../index.ts"; -import {Col, Descriptions, DescriptionsProps, Image, Row, Tabs, TabsProps, theme, Typography} from "antd"; +import { + Col, + ConfigProvider, + Descriptions, + DescriptionsProps, + Image, + Row, + Tabs, + TabsProps, + theme, + Typography +} from "antd"; import {Card} from "../../components"; -import {Outlet, useNavigate} from "react-router-dom"; +import {Outlet, useLocation, useNavigate} from "react-router-dom"; import {USER_PROFILE_ITEMS} from "../../constants"; import {useStylesContext} from "../../context"; const {Link} = Typography import "./styles.css" +import {useEffect, useState} from "react"; const DESCRIPTION_ITEMS: DescriptionsProps['items'] = [ { @@ -48,19 +60,44 @@ const UserAccountLayout = () => { const {token: {borderRadius}} = theme.useToken() const navigate = useNavigate() const stylesContext = useStylesContext() + const location = useLocation() + const [activeKey, setActiveKey] = useState(TAB_ITEMS[0].key); const onChange = (key: string) => { navigate(key) }; + useEffect(() => { + console.log(location) + const k = TAB_ITEMS.find(d => location.pathname.includes(d.key))?.key || "" + + console.log(k) + setActiveKey(k); + }, [location]); + return ( <> + + + ]} > diff --git a/src/pages/Sitemap.tsx b/src/pages/Sitemap.tsx index 333aee2..ceab547 100644 --- a/src/pages/Sitemap.tsx +++ b/src/pages/Sitemap.tsx @@ -1,13 +1,9 @@ import {SitemapCard} from "../components"; -import {Col, Row, RowProps, Typography} from "antd"; -import {CORPORATE_ITEMS, DASHBOARD_ITEMS} from "../constants"; +import {Col, Flex, Row, Typography} from "antd"; +import {CORPORATE_ITEMS, DASHBOARD_ITEMS, USER_PROFILE_ITEMS} from "../constants"; +import {useStylesContext} from "../context"; +import {BranchesOutlined} from "@ant-design/icons"; -const ROW_PROPS: RowProps = { - gutter: [ - {xs: 8, sm: 16, md: 24, lg: 32}, - {xs: 8, sm: 16, md: 24, lg: 32} - ] -} const SITES = [ { @@ -17,20 +13,28 @@ const SITES = [ { title: "corporate", links: CORPORATE_ITEMS + }, + { + title: "user profile", + links: USER_PROFILE_ITEMS } ] const SitemapPage = () => { + const context = useStylesContext() + return (
- Sitemap - - {SITES.map(s => - - - - )} - + + {' '}Sitemap + + {SITES.map(s => + + + + )} + +
); }; From 57e9fa3f2399f45902c512eea4aa78e4634e9fa2 Mon Sep 17 00:00:00 2001 From: Kelvin Kiptum Kiprop Date: Sun, 15 Oct 2023 23:33:28 +0300 Subject: [PATCH 2/4] - added user profiles to sitemap - updated sitemap card --- .changeset/mighty-kings-compare.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/mighty-kings-compare.md diff --git a/.changeset/mighty-kings-compare.md b/.changeset/mighty-kings-compare.md new file mode 100644 index 0000000..f7f454f --- /dev/null +++ b/.changeset/mighty-kings-compare.md @@ -0,0 +1,5 @@ +--- +"antd-multi-dashboard": minor +--- + +completed user profile pages and sections From 2f2f5b0f092a83af0a478968e48965f195f24bd5 Mon Sep 17 00:00:00 2001 From: Kelvin Kiptum Kiprop Date: Sun, 15 Oct 2023 23:33:28 +0300 Subject: [PATCH 3/4] - added user profiles to sitemap - updated sitemap card --- .changeset/mighty-kings-compare.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/mighty-kings-compare.md diff --git a/.changeset/mighty-kings-compare.md b/.changeset/mighty-kings-compare.md new file mode 100644 index 0000000..f7f454f --- /dev/null +++ b/.changeset/mighty-kings-compare.md @@ -0,0 +1,5 @@ +--- +"antd-multi-dashboard": minor +--- + +completed user profile pages and sections From e18bbf4332dbc20aa080f1292e89731296793a42 Mon Sep 17 00:00:00 2001 From: Kelvin Kiptum Kiprop Date: Sun, 15 Oct 2023 23:42:24 +0300 Subject: [PATCH 4/4] Create fair-books-look.md --- .changeset/fair-books-look.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .changeset/fair-books-look.md diff --git a/.changeset/fair-books-look.md b/.changeset/fair-books-look.md new file mode 100644 index 0000000..80f8765 --- /dev/null +++ b/.changeset/fair-books-look.md @@ -0,0 +1,11 @@ +--- +"antd-multi-dashboard": patch +--- + +### Added +- added user profile to sitemap +- added active tab styles on the user profile page + +### Updated +- updated sitemap card styles +- minor page-to-page transition update