File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ export const ExpandableRow = (props: RowProps) => {
151151 return (
152152 < StyledRow as = "li" key = { `${ row . lbl } -${ index } ` } >
153153 < span className = "lbl" title = { row . title ?. toString ( ) } > { row . lbl } </ span >
154- < span className = "val" title = { row . val } onClick = { ( ) => copyToClipboard ( row . val ) } >
154+ < span className = "val" title = { row . val ?. toString ( ) } onClick = { ( ) => copyToClipboard ( row . val ) } >
155155 { formatValue ( row . val ) }
156156 </ span >
157157 { row . plaintext && < PlainText > { row . plaintext } </ PlainText > }
Original file line number Diff line number Diff line change @@ -11,15 +11,17 @@ const cardStyles = `
1111` ;
1212
1313const RobotsTxtCard = ( props : { data : { robots : RowProps [ ] } , title : string , actionButtons : any } ) : JSX . Element => {
14- const robots = props . data ;
14+ const { data } = props ;
15+ const robots = data ?. robots || [ ] ;
16+
1517 return (
1618 < Card heading = { props . title } actionButtons = { props . actionButtons } styles = { cardStyles } >
1719 < div className = "content" >
1820 {
19- robots . robots . length === 0 && < p > No crawl rules found.</ p >
21+ robots . length === 0 && < p > No crawl rules found.</ p >
2022 }
2123 {
22- robots . robots . map ( ( row : RowProps , index : number ) => {
24+ robots . map ( ( row : RowProps , index : number ) => {
2325 return (
2426 < Row key = { `${ row . lbl } -${ index } ` } lbl = { row . lbl } val = { row . val } />
2527 )
Original file line number Diff line number Diff line change 11import styled from '@emotion/styled' ;
2+ import { useEffect } from 'react' ;
3+ import { useLocation } from 'react-router-dom' ;
24
35import colors from 'web-check-live/styles/colors' ;
46import Heading from 'web-check-live/components/Form/Heading' ;
@@ -118,6 +120,21 @@ const makeAnchor = (title: string): string => {
118120} ;
119121
120122const About = ( ) : JSX . Element => {
123+ const location = useLocation ( ) ;
124+
125+ useEffect ( ( ) => {
126+ // Scroll to hash fragment if present
127+ if ( location . hash ) {
128+ // Add a small delay to ensure the page has fully rendered
129+ setTimeout ( ( ) => {
130+ const element = document . getElementById ( location . hash . slice ( 1 ) ) ;
131+ if ( element ) {
132+ element . scrollIntoView ( { behavior : 'smooth' , block : 'start' } ) ;
133+ }
134+ } , 100 ) ;
135+ }
136+ } , [ location ] ) ;
137+
121138 return (
122139 < div >
123140 < AboutContainer >
Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ const Home = (): JSX.Element => {
278278 < Heading as = "h2" size = "small" color = { colors . primary } > Supported Checks</ Heading >
279279 < ul >
280280 { docs . map ( ( doc , index ) => ( < li key = { index } > { doc . title } </ li > ) ) }
281- < li > < Link to = "/about" > + more!</ Link > </ li >
281+ < li > < Link to = "/check/ about" > + more!</ Link > </ li >
282282 </ ul >
283283 </ div >
284284 < div className = "links" >
@@ -288,7 +288,7 @@ const Home = (): JSX.Element => {
288288 < 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" >
289289 < Button > Deploy your own</ Button >
290290 </ a >
291- < Link to = "/about#api-documentation" title = "View the API documentation, to use Web-Check programmatically" >
291+ < Link to = "/check/ about#api-documentation" title = "View the API documentation, to use Web-Check programmatically" >
292292 < Button > API Docs</ Button >
293293 </ Link >
294294 </ div >
You can’t perform that action at this time.
0 commit comments