1- import { ReactElement } from 'react'
1+ /* eslint-disable jsx-a11y/anchor-is-valid */
2+ import { Dispatch , FC , MouseEvent , SetStateAction , useState } from 'react'
23
34import { ContentLayout } from '~/libs/ui'
45
6+ import { ContactSupportModal } from '../../../components'
7+
58import styles from './RestrictedPage.module.scss'
69
7- export const RestrictedPage : ReactElement
8- = (
10+ export const RestrictedPage : FC < { } > = ( ) => {
11+ const [ showSupportModal , setShowSupportModal ] : [ boolean , Dispatch < SetStateAction < boolean > > ] = useState ( false )
12+
13+ function openSupportModal ( e : MouseEvent < HTMLAnchorElement > ) : void {
14+ e . preventDefault ( )
15+ setShowSupportModal ( true )
16+ }
17+
18+ function closeSupportModal ( ) : void {
19+ setShowSupportModal ( false )
20+ }
21+
22+ return (
923 < ContentLayout
1024 contentClass = { styles . contentLayout }
1125 outerClass = { styles [ 'contentLayout-outer' ] }
@@ -15,9 +29,21 @@ export const RestrictedPage: ReactElement
1529 < div className = { styles . container } >
1630 < p >
1731 Unfortunately, you are not permitted to access the site. If you feel you should be able to, please
18- < a href = '/support' > contact us</ a >
32+ { ' ' }
33+ < a
34+ href = '#support'
35+ onClick = { openSupportModal }
36+ >
37+ contact us
38+ </ a >
1939 .
2040 </ p >
2141 </ div >
42+
43+ < ContactSupportModal
44+ isOpen = { showSupportModal }
45+ onClose = { closeSupportModal }
46+ />
2247 </ ContentLayout >
2348 )
49+ }
0 commit comments