From cdf7875ddbfd0ba46b914ceb447b3261d0e6e12a Mon Sep 17 00:00:00 2001 From: tnga Date: Thu, 12 Jun 2025 14:09:52 +0100 Subject: [PATCH 1/4] fix: Fix navigation links and add smooth scrolling to hash fragments - Update Link components in Home.tsx to use correct /check prefix for routing - Add useEffect hook in About.tsx to handle smooth scrolling to hash fragments - Add delay to ensure page renders before scrolling to target element --- src/web-check-live/views/About.tsx | 17 +++++++++++++++++ src/web-check-live/views/Home.tsx | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) 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 (
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 => { Supported Checks
    {docs.map((doc, index) => (
  • {doc.title}
  • ))} -
  • + more!
  • +
  • + more!
@@ -288,7 +288,7 @@ const Home = (): JSX.Element => { - +
From 4603828b92c0e58eaf10576fd478b07df4e80094 Mon Sep 17 00:00:00 2001 From: tnga Date: Thu, 12 Jun 2025 19:54:33 +0100 Subject: [PATCH 2/4] fix: change web-check.zyz link to expected web-check.xyz --- public/assets/badges/webcheck.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 64510f7e7ea5b3dcb9afffe84935422681cf29c8 Mon Sep 17 00:00:00 2001 From: tnga Date: Mon, 16 Jun 2025 07:15:01 +0100 Subject: [PATCH 3/4] fix: add toString() to prevent title attribute TypeError on non-string values --- src/web-check-live/components/Form/Row.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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> } From c0c146b2b98dbf139fba2567c2a128e1ded7990d Mon Sep 17 00:00:00 2001 From: tnga <devtnga@gmail.com> Date: Mon, 16 Jun 2025 07:20:26 +0100 Subject: [PATCH 4/4] fix: handle undefined robots data and improve object destructuring in RobotsTxt component --- src/web-check-live/components/Results/RobotsTxt.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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} /> )