File tree Expand file tree Collapse file tree 5 files changed +26
-7
lines changed Expand file tree Collapse file tree 5 files changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ export const ExpandableRow = (props: RowProps) => {
151
151
return (
152
152
< StyledRow as = "li" key = { `${ row . lbl } -${ index } ` } >
153
153
< 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 ) } >
155
155
{ formatValue ( row . val ) }
156
156
</ span >
157
157
{ row . plaintext && < PlainText > { row . plaintext } </ PlainText > }
Original file line number Diff line number Diff line change @@ -11,15 +11,17 @@ const cardStyles = `
11
11
` ;
12
12
13
13
const 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
+
15
17
return (
16
18
< Card heading = { props . title } actionButtons = { props . actionButtons } styles = { cardStyles } >
17
19
< div className = "content" >
18
20
{
19
- robots . robots . length === 0 && < p > No crawl rules found.</ p >
21
+ robots . length === 0 && < p > No crawl rules found.</ p >
20
22
}
21
23
{
22
- robots . robots . map ( ( row : RowProps , index : number ) => {
24
+ robots . map ( ( row : RowProps , index : number ) => {
23
25
return (
24
26
< Row key = { `${ row . lbl } -${ index } ` } lbl = { row . lbl } val = { row . val } />
25
27
)
Original file line number Diff line number Diff line change 1
1
import styled from '@emotion/styled' ;
2
+ import { useEffect } from 'react' ;
3
+ import { useLocation } from 'react-router-dom' ;
2
4
3
5
import colors from 'web-check-live/styles/colors' ;
4
6
import Heading from 'web-check-live/components/Form/Heading' ;
@@ -118,6 +120,21 @@ const makeAnchor = (title: string): string => {
118
120
} ;
119
121
120
122
const 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
+
121
138
return (
122
139
< div >
123
140
< AboutContainer >
Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ const Home = (): JSX.Element => {
278
278
< Heading as = "h2" size = "small" color = { colors . primary } > Supported Checks</ Heading >
279
279
< ul >
280
280
{ 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 >
282
282
</ ul >
283
283
</ div >
284
284
< div className = "links" >
@@ -288,7 +288,7 @@ const Home = (): JSX.Element => {
288
288
< 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" >
289
289
< Button > Deploy your own</ Button >
290
290
</ 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" >
292
292
< Button > API Docs</ Button >
293
293
</ Link >
294
294
</ div >
You can’t perform that action at this time.
0 commit comments