mirror of
https://github.com/Lissy93/web-check.git
synced 2025-02-17 02:40:46 +01:00
Update homepage and about page
This commit is contained in:
parent
d6da8e123e
commit
db3322856b
@ -30,7 +30,7 @@ export const Card = (props: CardProps): JSX.Element => {
|
|||||||
<ErrorBoundary title={heading}>
|
<ErrorBoundary title={heading}>
|
||||||
<StyledCard styles={styles}>
|
<StyledCard styles={styles}>
|
||||||
{ actionButtons && actionButtons }
|
{ actionButtons && actionButtons }
|
||||||
{ heading && <Heading as="h3" align="left" color={colors.primary}>{heading}</Heading> }
|
{ heading && <Heading className="inner-heading" as="h3" align="left" color={colors.primary}>{heading}</Heading> }
|
||||||
{children}
|
{children}
|
||||||
</StyledCard>
|
</StyledCard>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
|
@ -10,6 +10,7 @@ interface HeadingProps {
|
|||||||
inline?: boolean;
|
inline?: boolean;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
id?: string;
|
id?: string;
|
||||||
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const StyledHeading = styled.h1<HeadingProps>`
|
const StyledHeading = styled.h1<HeadingProps>`
|
||||||
@ -47,10 +48,14 @@ const StyledHeading = styled.h1<HeadingProps>`
|
|||||||
${props => props.inline ? 'display: inline;' : '' }
|
${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 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 (
|
return (
|
||||||
<StyledHeading as={as} size={size} align={align} color={color} inline={inline} id={id}>
|
<StyledHeading as={as} size={size} align={align} color={color} inline={inline} className={className} id={id || makeAnchor((children || '')?.toString())}>
|
||||||
{children}
|
{children}
|
||||||
</StyledHeading>
|
</StyledHeading>
|
||||||
);
|
);
|
||||||
|
@ -8,7 +8,7 @@ margin: 0;
|
|||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 0.5rem;
|
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 {
|
li a.resource-wrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: start;
|
align-items: start;
|
||||||
@ -192,7 +192,7 @@ const resources = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const makeLink = (resource: any, scanUrl: string | undefined): string => {
|
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 => {
|
const AdditionalResources = (props: { url?: string }): JSX.Element => {
|
||||||
|
@ -5,6 +5,7 @@ import Heading from 'components/Form/Heading';
|
|||||||
import Footer from 'components/misc/Footer';
|
import Footer from 'components/misc/Footer';
|
||||||
import Nav from 'components/Form/Nav';
|
import Nav from 'components/Form/Nav';
|
||||||
import Button from 'components/Form/Button';
|
import Button from 'components/Form/Button';
|
||||||
|
import AdditionalResources from 'components/misc/AdditionalResources';
|
||||||
import { StyledCard } from 'components/Form/Card';
|
import { StyledCard } from 'components/Form/Card';
|
||||||
import docs, { about, license, fairUse, supportUs } from 'utils/docs';
|
import docs, { about, license, fairUse, supportUs } from 'utils/docs';
|
||||||
|
|
||||||
@ -18,6 +19,10 @@ header {
|
|||||||
margin 1rem 0;
|
margin 1rem 0;
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
section {
|
||||||
|
width: auto;
|
||||||
|
.inner-heading { display: none; }
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const HeaderLinkContainer = styled.nav`
|
const HeaderLinkContainer = styled.nav`
|
||||||
@ -86,7 +91,6 @@ const makeAnchor = (title: string): string => {
|
|||||||
return title.toLowerCase().replace(/[^\w\s]|_/g, "").replace(/\s+/g, "-");
|
return title.toLowerCase().replace(/[^\w\s]|_/g, "").replace(/\s+/g, "-");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const About = (): JSX.Element => {
|
const About = (): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@ -148,6 +152,14 @@ const About = (): JSX.Element => {
|
|||||||
))}
|
))}
|
||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
|
<Heading as="h2" size="medium" color={colors.primary}>API Documentation</Heading>
|
||||||
|
<Section>
|
||||||
|
<p>// Coming soon...</p>
|
||||||
|
</Section>
|
||||||
|
|
||||||
|
<Heading as="h2" size="medium" color={colors.primary}>Additional Resources</Heading>
|
||||||
|
<AdditionalResources />
|
||||||
|
|
||||||
<Heading as="h2" size="medium" color={colors.primary}>Support Us</Heading>
|
<Heading as="h2" size="medium" color={colors.primary}>Support Us</Heading>
|
||||||
<Section>
|
<Section>
|
||||||
{supportUs.map((para, index: number) => (<p dangerouslySetInnerHTML={{__html: para}} />))}
|
{supportUs.map((para, index: number) => (<p dangerouslySetInnerHTML={{__html: para}} />))}
|
||||||
|
@ -179,8 +179,15 @@ const Home = (): JSX.Element => {
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div className="links">
|
<div className="links">
|
||||||
<a href="https://app.netlify.com/start/deploy?repository=https://github.com/lissy93/web-check"><Button>Deploy your own Instance</Button></a>
|
<a href="https://github.com/lissy93/web-check" title="Check out the source code and documentation on GitHub, and get support or contribute">
|
||||||
<a href="https://github.com/lissy93/web-check"><Button>View on GitHub</Button></a>
|
<Button>View on GitHub</Button>
|
||||||
|
</a>
|
||||||
|
<a href="https://app.netlify.com/start/deploy?repository=https://github.com/lissy93/web-check" title="Deploy your own private or public instance of Web-Check to Netlify">
|
||||||
|
<Button>Deploy your own</Button>
|
||||||
|
</a>
|
||||||
|
<a href="/about#api-documentation" title="View the API documentation, to use Web-Check programmatically">
|
||||||
|
<Button>API Docs</Button>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</SiteFeaturesWrapper>
|
</SiteFeaturesWrapper>
|
||||||
<Footer isFixed={true} />
|
<Footer isFixed={true} />
|
||||||
|
Loading…
Reference in New Issue
Block a user