From 019fb0fab8ad8f51665aca9f8532a704596e8890 Mon Sep 17 00:00:00 2001 From: Bjarke Madsen <bjarke@nordu.net> Date: Tue, 23 May 2023 15:20:04 +0200 Subject: [PATCH] Update the sidebar to support different sections --- webapp/src/components/DataPage.tsx | 4 +++- webapp/src/components/OrganizationSidebar.tsx | 5 ----- webapp/src/components/PolicySidebar.tsx | 19 +++++++++++++++++++ webapp/src/scss/layout/Sidebar.scss | 1 + 4 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 webapp/src/components/PolicySidebar.tsx diff --git a/webapp/src/components/DataPage.tsx b/webapp/src/components/DataPage.tsx index ba9b1997..243cd2ea 100644 --- a/webapp/src/components/DataPage.tsx +++ b/webapp/src/components/DataPage.tsx @@ -5,6 +5,7 @@ import PageHeader from "../components/global/PageHeader" import SectionLink from "../components/global/SectionLink"; import SectionNavigation from "./SectionNavigation"; import { Sections } from "../helpers/constants"; +import PolicySidebar from "./PolicySidebar"; interface inputProps { title: string, @@ -16,7 +17,8 @@ interface inputProps { function DataPage({ title, filter, children, category }: inputProps): ReactElement { return ( <> - <OrganizationSidebar /> + {category === Sections.Organisation && <OrganizationSidebar />} + {category === Sections.Policy && <PolicySidebar />} <PageHeader type={'data'} header={'Compendium Data'}> <SectionLink section={"Reports"} /> </PageHeader> diff --git a/webapp/src/components/OrganizationSidebar.tsx b/webapp/src/components/OrganizationSidebar.tsx index 3805351e..116b6a76 100644 --- a/webapp/src/components/OrganizationSidebar.tsx +++ b/webapp/src/components/OrganizationSidebar.tsx @@ -50,11 +50,6 @@ const OrganizationSidebar = () => { <span>NREN Involvement in European Commission Projects</span> </Link> </Row> - <Row> - <Link to="/policy" className="link-text-underline"> - <span>NREN Policies</span> - </Link> - </Row> </Sidebar> ) } diff --git a/webapp/src/components/PolicySidebar.tsx b/webapp/src/components/PolicySidebar.tsx new file mode 100644 index 00000000..2273db42 --- /dev/null +++ b/webapp/src/components/PolicySidebar.tsx @@ -0,0 +1,19 @@ +import React from 'react'; +import { Link } from 'react-router-dom'; +import { Row } from 'react-bootstrap'; +import Sidebar from './SideBar'; + +const PolicySidebar = () => { + return ( + <Sidebar> + <h5>Standards and Policies</h5> + <Row> + <Link to="/policy" className="link-text-underline"> + <span>NREN Policies</span> + </Link> + </Row> + </Sidebar> + ) +} + +export default PolicySidebar \ No newline at end of file diff --git a/webapp/src/scss/layout/Sidebar.scss b/webapp/src/scss/layout/Sidebar.scss index 4efb5c28..6c4df14b 100644 --- a/webapp/src/scss/layout/Sidebar.scss +++ b/webapp/src/scss/layout/Sidebar.scss @@ -21,6 +21,7 @@ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); border: $yellow-orange 2px solid; pointer-events: auto; + width: 28rem; a { padding-top: 0.3rem; -- GitLab