Skip to content

Commit

Permalink
Merge pull request #497 from mithraiclabs/feat/disclaimer
Browse files Browse the repository at this point in the history
Create basic disclaimer modal
  • Loading branch information
evanpipta authored Aug 13, 2021
2 parents deda09d + 8c6ddb2 commit 9a89e78
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
62 changes: 62 additions & 0 deletions src/components/Disclaimer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React from 'react'
import Dialog from '@material-ui/core/Dialog'
import Box from '@material-ui/core/Box'
import Button from '@material-ui/core/Button'
import useLocalStorageState from 'use-local-storage-state'

const Disclaimer = () => {
const [hasAcceptedDisclaimer, setHasAcceptedDisclaimer] =
useLocalStorageState('hasAcceptedDisclaimer', false)

const dismissDisclaimer = () => {
setHasAcceptedDisclaimer(true)
}

return (
<Dialog open={!hasAcceptedDisclaimer} maxWidth={'lg'}>
<Box p={2} width="740px" maxWidth="100%">
<Box px={1} py={2} textAlign="center">
<h2 style={{ margin: '0' }}>Warning!</h2>
</Box>
<Box fontWeight={400}>
<Box p={1}>
PsyOptions is beta software and is a fully decentralized options
protocol. No representation or warranty is made concerning any
aspect of PsyOptions, including its suitability, quality,
availability, accessibility, accuracy or safety. Your access to and
use of PsyOptions is entirely at your own risk and could lead to
substantial losses. You take full responsibility for your use of
PsyOptions, and acknowledge that you use it on the basis of your own
enquiry.
</Box>
<Box p={1}>
PsyOptions is not available to residents of:{' '}
<span style={{ fontWeight: 700 }}>
Belarus, the Central African Republic, the Democratic Republic of
Congo, the Democratic People’s Republic of Korea, the Crimea
region of Ukraine, Cuba, Iran, Libya, Somalia, Sudan, South Sudan,
Syria, the USA, Yemen, and Zimbabwe or any other jurisdiction in
which accessing or using this website is prohibited.{' '}
</span>
</Box>
<Box p={1}>
In using PsyOptions, you confirm that you are not located in,
incorporated or otherwise established in, or a citizen or resident
of any of the above jurisdictions.
</Box>
</Box>
<Box px={1} py={2} textAlign="center">
<Button
color="primary"
variant="outlined"
onClick={dismissDisclaimer}
>
Accept and Continue
</Button>
</Box>
</Box>
</Dialog>
)
}

export default Disclaimer
2 changes: 2 additions & 0 deletions src/components/pages/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Box from '@material-ui/core/Box'
import StatusBar from '../StatusBar'
import Notifications from '../Notifications'
import Footer from '../Footer'
import Disclaimer from '../Disclaimer'

// Default page template
const Page: React.FC<{
Expand All @@ -29,6 +30,7 @@ const Page: React.FC<{
>
<Box minHeight="100%">{children}</Box>
</Box>
<Disclaimer />
<Footer />
</Box>
</>
Expand Down

0 comments on commit 9a89e78

Please sign in to comment.