1- import { useEffect } from 'react' ;
1+ import { useCallback , useEffect } from 'react' ;
22import { useRouteError } from 'react-router-dom' ;
33
44import useBooleanState from '#hooks/useBooleanState' ;
5- import Button , { useButtonFeatures } from '#components/Button' ;
5+ import Button from '#components/Button' ;
6+ import Link from '#components/Link' ;
67
78import styles from './styles.module.css' ;
89
@@ -24,9 +25,15 @@ function PageError() {
2425 toggle : toggleFullErrorVisibility ,
2526 } ,
2627 ] = useBooleanState ( false ) ;
27- const {
28- className : containerClassName ,
29- } = useButtonFeatures ( { } ) ;
28+
29+ const handleReloadButtonClick = useCallback (
30+ ( ) => {
31+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
32+ // @ts -ignore
33+ window . location . reload ( true ) ;
34+ } ,
35+ [ ] ,
36+ ) ;
3037
3138 return (
3239 < div className = { styles . pageError } >
@@ -66,13 +73,21 @@ function PageError() {
6673 </ div >
6774 < div className = { styles . footer } >
6875 { /* NOTE: using the anchor element as it will refresh the page */ }
69- < a
70- className = { containerClassName }
76+ < Link
7177 href = "/"
78+ external
79+ variant = "secondary"
7280 >
7381 { /* FIXME: use translations */ }
7482 Go back to homepage
75- </ a >
83+ </ Link >
84+ < Button
85+ name = { undefined }
86+ onClick = { handleReloadButtonClick }
87+ >
88+ { /* FIXME: use translations */ }
89+ Reload
90+ </ Button >
7691 </ div >
7792 </ div >
7893 </ div >
0 commit comments