From db3322856b5baacc2869b9957ccc8903d8596fe7 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 29 Jul 2023 19:42:20 +0100 Subject: [PATCH] Update homepage and about page --- src/components/Form/Card.tsx | 2 +- src/components/Form/Heading.tsx | 9 +++++++-- src/components/misc/AdditionalResources.tsx | 4 ++-- src/pages/About.tsx | 14 +++++++++++++- src/pages/Home.tsx | 11 +++++++++-- 5 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/components/Form/Card.tsx b/src/components/Form/Card.tsx index c178d92..1721e97 100644 --- a/src/components/Form/Card.tsx +++ b/src/components/Form/Card.tsx @@ -30,7 +30,7 @@ export const Card = (props: CardProps): JSX.Element => { { actionButtons && actionButtons } - { heading && {heading} } + { heading && {heading} } {children} diff --git a/src/components/Form/Heading.tsx b/src/components/Form/Heading.tsx index 49dd715..0dd18a5 100644 --- a/src/components/Form/Heading.tsx +++ b/src/components/Form/Heading.tsx @@ -10,6 +10,7 @@ interface HeadingProps { inline?: boolean; children: React.ReactNode; id?: string; + className?: string; }; const StyledHeading = styled.h1` @@ -47,10 +48,14 @@ const StyledHeading = styled.h1` ${props => props.inline ? 'display: inline;' : '' } `; +const makeAnchor = (title: string): string => { + return title.toLowerCase().replace(/[^\w\s]|_/g, "").replace(/\s+/g, "-"); +}; + const Heading = (props: HeadingProps): JSX.Element => { - const { children, as, size, align, color, inline, id } = props; + const { children, as, size, align, color, inline, id, className } = props; return ( - + {children} ); diff --git a/src/components/misc/AdditionalResources.tsx b/src/components/misc/AdditionalResources.tsx index 663fc8f..577b790 100644 --- a/src/components/misc/AdditionalResources.tsx +++ b/src/components/misc/AdditionalResources.tsx @@ -8,7 +8,7 @@ margin: 0; padding: 1rem; display: grid; gap: 0.5rem; -grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); +grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); li a.resource-wrap { display: flex; align-items: start; @@ -192,7 +192,7 @@ const resources = [ ]; const makeLink = (resource: any, scanUrl: string | undefined): string => { - return (scanUrl && resource.searchLink) ? resource.searchLink.replaceAll('{URL}', scanUrl.replace('https://', '')) : '#'; + return (scanUrl && resource.searchLink) ? resource.searchLink.replaceAll('{URL}', scanUrl.replace('https://', '')) : resource.link; }; const AdditionalResources = (props: { url?: string }): JSX.Element => { diff --git a/src/pages/About.tsx b/src/pages/About.tsx index 384770f..58938e0 100644 --- a/src/pages/About.tsx +++ b/src/pages/About.tsx @@ -5,6 +5,7 @@ import Heading from 'components/Form/Heading'; import Footer from 'components/misc/Footer'; import Nav from 'components/Form/Nav'; import Button from 'components/Form/Button'; +import AdditionalResources from 'components/misc/AdditionalResources'; import { StyledCard } from 'components/Form/Card'; import docs, { about, license, fairUse, supportUs } from 'utils/docs'; @@ -18,6 +19,10 @@ header { margin 1rem 0; width: auto; } +section { + width: auto; + .inner-heading { display: none; } +} `; const HeaderLinkContainer = styled.nav` @@ -86,7 +91,6 @@ const makeAnchor = (title: string): string => { return title.toLowerCase().replace(/[^\w\s]|_/g, "").replace(/\s+/g, "-"); }; - const About = (): JSX.Element => { return (
@@ -148,6 +152,14 @@ const About = (): JSX.Element => { ))} + API Documentation +
+

// Coming soon...

+
+ + Additional Resources + + Support Us
{supportUs.map((para, index: number) => (

))} diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 33be540..bf2afba 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -179,8 +179,15 @@ const Home = (): JSX.Element => {

- - + + + + + + + + +