-
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
Showing
5 changed files
with
132 additions
and
29 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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
const USER_SESSION_KEY = "userInSession"; | ||
const CB_TERMS_AND_PRIVACY = "CB_TERMS_AND_PRIVACY"; | ||
export { USER_SESSION_KEY, CB_TERMS_AND_PRIVACY }; | ||
const CB_COOKIES = "CB_COOKIES"; | ||
export { USER_SESSION_KEY, CB_TERMS_AND_PRIVACY, CB_COOKIES }; |
114 changes: 114 additions & 0 deletions
114
ui/summit-2024/src/components/LegalOptInModal/Cookies.tsx
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,114 @@ | ||
import Modal from "../common/Modal/Modal"; | ||
import {useLocalStorage} from "../../common/hooks/useLocalStorage"; | ||
import {CB_COOKIES} from "../../common/constants/local"; | ||
import {Box, Button, Typography} from "@mui/material"; | ||
|
||
export enum CookiesStatus { | ||
ACCEPT = "ACCEPT", | ||
REJECT = "REJECT" | ||
} | ||
|
||
const Cookies = () => { | ||
const [cookies, setCookies] = | ||
useLocalStorage(CB_COOKIES, undefined); | ||
|
||
const handleAccept = (status?:string) => { | ||
setCookies(status || CookiesStatus.ACCEPT) | ||
} | ||
|
||
const handleReject = () => { | ||
setCookies(true) | ||
} | ||
|
||
const handlePrivacyPolicy = () => { | ||
// TODO: open privacy and policy page | ||
} | ||
|
||
return ( | ||
<> | ||
<Modal | ||
id="connect-wallet-modal" | ||
isOpen={!cookies} | ||
name="connect-wallet-modal" | ||
title="Cookie Policy" | ||
width={"620px"} | ||
onClose={() => setCookies(CookiesStatus.REJECT)} | ||
onBack={() => setCookies(CookiesStatus.REJECT)} | ||
disableBackdropClick | ||
> | ||
<Box sx={{ | ||
padding: 2, | ||
borderRadius: 1, | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
gap: 2 | ||
}}> | ||
<Typography sx={{ | ||
color: 'var(--neutralLight, #D2D2D9)', | ||
fontSize: '16px', | ||
fontWeight: 500, | ||
lineHeight: '24px', | ||
textAlign: 'center' | ||
}}> | ||
We use cookies on this website to help improve your overall experience. By clicking accept you agree to our privacy policy. | ||
</Typography> | ||
<Box sx={{ display: 'flex', gap: 1 }}> | ||
<Button onClick={handlePrivacyPolicy} sx={{ | ||
display: 'flex', | ||
width: '180px', | ||
padding: '16px 24px', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
borderRadius: '12px', | ||
border: '1px solid var(--orange, #EE9766)', | ||
color: 'var(--orange, #EE9766)', | ||
fontSize: '16px', | ||
fontWeight: 500, | ||
lineHeight: '24px', | ||
textTransform: "none" | ||
}}> | ||
Privacy Policy | ||
</Button> | ||
<Button onClick={handleReject} sx={{ | ||
display: 'flex', | ||
width: '180px', | ||
padding: '16px 24px', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
borderRadius: '12px', | ||
border: '1px solid var(--orange, #EE9766)', | ||
color: 'var(--orange, #EE9766)', | ||
fontSize: '16px', | ||
fontWeight: 500, | ||
lineHeight: '24px', | ||
textTransform: "none" | ||
}}> | ||
Reject | ||
</Button> | ||
<Button onClick={handleAccept} sx={{ | ||
display: 'flex', | ||
width: '180px', | ||
padding: '16px 24px', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
borderRadius: '12px', | ||
background: 'linear-gradient(70deg, #0C7BC5 -105.24%, #40407D -53.72%, #EE9766 -0.86%, #EE9766 103.82%)', | ||
color: 'var(--neutralDarkest, #121212)', | ||
fontSize: '16px', | ||
fontWeight: 500, | ||
lineHeight: '24px', | ||
textTransform: "none" | ||
}}> | ||
Accept | ||
</Button> | ||
</Box> | ||
</Box> | ||
</Modal> | ||
</> | ||
) | ||
} | ||
|
||
export { | ||
Cookies | ||
} |
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
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