diff --git a/public/assets/badges/webcheck.svg b/public/assets/badges/webcheck.svg index a5f7287..b7154a0 100644 --- a/public/assets/badges/webcheck.svg +++ b/public/assets/badges/webcheck.svg @@ -1 +1 @@ -Website: web-check.zyzWebsitewebcheck.zyz +Website: web-check.xyzWebsitewebcheck.zyz diff --git a/src/web-check-live/components/Form/Row.tsx b/src/web-check-live/components/Form/Row.tsx index c1aee0c..e51c368 100644 --- a/src/web-check-live/components/Form/Row.tsx +++ b/src/web-check-live/components/Form/Row.tsx @@ -151,7 +151,7 @@ export const ExpandableRow = (props: RowProps) => { return ( {row.lbl} - copyToClipboard(row.val)}> + copyToClipboard(row.val)}> {formatValue(row.val)} { row.plaintext && {row.plaintext}</PlainText> } diff --git a/src/web-check-live/components/Results/RobotsTxt.tsx b/src/web-check-live/components/Results/RobotsTxt.tsx index d7a9511..b25efcf 100644 --- a/src/web-check-live/components/Results/RobotsTxt.tsx +++ b/src/web-check-live/components/Results/RobotsTxt.tsx @@ -11,15 +11,17 @@ const cardStyles = ` `; const RobotsTxtCard = ( props: { data: { robots: RowProps[]}, title: string, actionButtons: any}): JSX.Element => { - const robots = props.data; + const { data } = props; + const robots = data?.robots || []; + return ( <Card heading={props.title} actionButtons={props.actionButtons} styles={cardStyles}> <div className="content"> { - robots.robots.length === 0 && <p>No crawl rules found.</p> + robots.length === 0 && <p>No crawl rules found.</p> } { - robots.robots.map((row: RowProps, index: number) => { + robots.map((row: RowProps, index: number) => { return ( <Row key={`${row.lbl}-${index}`} lbl={row.lbl} val={row.val} /> ) diff --git a/src/web-check-live/views/About.tsx b/src/web-check-live/views/About.tsx index 7c10aac..2704d32 100644 --- a/src/web-check-live/views/About.tsx +++ b/src/web-check-live/views/About.tsx @@ -1,4 +1,6 @@ import styled from '@emotion/styled'; +import { useEffect } from 'react'; +import { useLocation } from 'react-router-dom'; import colors from 'web-check-live/styles/colors'; import Heading from 'web-check-live/components/Form/Heading'; @@ -118,6 +120,21 @@ const makeAnchor = (title: string): string => { }; const About = (): JSX.Element => { + const location = useLocation(); + + useEffect(() => { + // Scroll to hash fragment if present + if (location.hash) { + // Add a small delay to ensure the page has fully rendered + setTimeout(() => { + const element = document.getElementById(location.hash.slice(1)); + if (element) { + element.scrollIntoView({ behavior: 'smooth', block: 'start' }); + } + }, 100); + } + }, [location]); + return ( <div> <AboutContainer> diff --git a/src/web-check-live/views/Home.tsx b/src/web-check-live/views/Home.tsx index 7389821..ce22f5a 100644 --- a/src/web-check-live/views/Home.tsx +++ b/src/web-check-live/views/Home.tsx @@ -278,7 +278,7 @@ const Home = (): JSX.Element => { <Heading as="h2" size="small" color={colors.primary}>Supported Checks</Heading> <ul> {docs.map((doc, index) => (<li key={index}>{doc.title}</li>))} - <li><Link to="/about">+ more!</Link></li> + <li><Link to="/check/about">+ more!</Link></li> </ul> </div> <div className="links"> @@ -288,7 +288,7 @@ const Home = (): JSX.Element => { <a target="_blank" rel="noreferrer" 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> - <Link to="/about#api-documentation" title="View the API documentation, to use Web-Check programmatically"> + <Link to="/check/about#api-documentation" title="View the API documentation, to use Web-Check programmatically"> <Button>API Docs</Button> </Link> </div>