-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
078b831
commit 1e31a45
Showing
2 changed files
with
62 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { useState } from 'preact/compat'; | ||
import { Button, Checkbox, Link } from 'react-daisyui'; | ||
import { useLocalStorage } from '../../hooks/useLocalStorage'; | ||
import { Dialog } from '../Dialog'; | ||
|
||
export const TermsAndConditions = () => { | ||
const { set, state } = useLocalStorage<string | undefined>({ key: 'TERMS_AND_CONDITIONS' }); | ||
const [checked, setChecked] = useState<boolean>(false); | ||
|
||
const acceptTerms = () => { | ||
set('accepted'); | ||
}; | ||
|
||
const content = ( | ||
<> | ||
<div className="mb-5 text-lg"> | ||
<Link | ||
style={{ textDecoration: 'underline' }} | ||
color="accent" | ||
target="_blank" | ||
rel="noreferrer" | ||
href="https://pendulumchain.org/legal/portal-terms-and-conditions" | ||
> | ||
View Terms and Conditions | ||
</Link> | ||
</div> | ||
<div className="flex text-lg"> | ||
<Checkbox checked={checked} onClick={() => setChecked(!checked)} color="primary" size="md" /> | ||
<span className="pl-2">I have read and accept the terms and conditions</span> | ||
</div> | ||
</> | ||
); | ||
|
||
const actions = ( | ||
<Button className="w-full px-12 text-thin" color="primary" onClick={acceptTerms} disabled={!checked}> | ||
Agree | ||
</Button> | ||
); | ||
|
||
return ( | ||
<Dialog | ||
content={content} | ||
headerText="T&Cs" | ||
visible={!state} | ||
actions={actions} | ||
hideCloseButton={true} | ||
disableNativeEvents={true} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters