From 1e31a45568c9e838f1b57ff4dc1407031c7e31d2 Mon Sep 17 00:00:00 2001 From: Kacper Szarkiewicz Date: Fri, 16 Aug 2024 13:03:13 +0200 Subject: [PATCH] Add Terms and Conditions dialog --- src/components/TermsAndConditions/index.tsx | 50 +++++++++++++++++++++ src/pages/swap/index.tsx | 20 +++++---- 2 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 src/components/TermsAndConditions/index.tsx diff --git a/src/components/TermsAndConditions/index.tsx b/src/components/TermsAndConditions/index.tsx new file mode 100644 index 00000000..4a6d9b08 --- /dev/null +++ b/src/components/TermsAndConditions/index.tsx @@ -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({ key: 'TERMS_AND_CONDITIONS' }); + const [checked, setChecked] = useState(false); + + const acceptTerms = () => { + set('accepted'); + }; + + const content = ( + <> +
+ + View Terms and Conditions + +
+
+ setChecked(!checked)} color="primary" size="md" /> + I have read and accept the terms and conditions +
+ + ); + + const actions = ( + + ); + + return ( + + ); +}; diff --git a/src/pages/swap/index.tsx b/src/pages/swap/index.tsx index 643ef64c..6112cea9 100644 --- a/src/pages/swap/index.tsx +++ b/src/pages/swap/index.tsx @@ -22,6 +22,7 @@ import { multiplyByPowerOfTen, stringifyBigWithSignificantDecimals } from '../.. import { ProgressPage } from '../progress'; import { SuccessPage } from '../success'; import { FailurePage } from '../failure'; +import { TermsAndConditions } from '../../components/TermsAndConditions'; const Arrow = () => (
@@ -189,14 +190,17 @@ export const SwapPage = () => { })); const modals = ( - setModalType(undefined)} - isLoading={false} - /> + <> + + setModalType(undefined)} + isLoading={false} + /> + ); if (offrampingPhase === 'success') {