-
Notifications
You must be signed in to change notification settings - Fork 259
feat: add consent screen #2420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: add consent screen #2420
Changes from 5 commits
5fd5ed8
bf7567a
1f92a53
8ec3811
375ebf5
7403d93
8e6e769
95d0da7
92a1630
8c25b8d
7a4cf10
9108c09
3ab20b1
5c3bde5
35f0cd9
4775a09
0dbdd78
9006216
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,8 +19,17 @@ function RootContent(props: RootProps) { | |
| const { onCloseLoader } = props; | ||
|
|
||
| const { modalState, shouldShowLoginPage, showPasswordLessInput, areSocialLoginsVisible } = useModalState(); | ||
| const { appLogo, deviceDetails, uiConfig, isConnectAndSignAuthenticationMode, handleMobileVerifyConnect } = useWidget(); | ||
| const { | ||
| appLogo, | ||
| deviceDetails, | ||
| uiConfig, | ||
| isConnectAndSignAuthenticationMode, | ||
| handleMobileVerifyConnect, | ||
| handleAcceptConsent, | ||
| handleDeclineConsent, | ||
| } = useWidget(); | ||
| const { chainNamespaces, walletRegistry, privacyPolicy, tncLink, displayInstalledExternalWallets, hideSuccessScreen } = uiConfig; | ||
| const consentRequired = Boolean("consentRequired" in uiConfig && uiConfig.consentRequired); | ||
|
|
||
| const contentRef = useRef<HTMLDivElement>(null); | ||
| const [containerHeight, setContainerHeight] = useState(530); | ||
|
|
@@ -188,6 +197,8 @@ function RootContent(props: RootProps) { | |
| return modalState.status !== MODAL_STATUS.INITIALIZED; | ||
| }, [modalState.status]); | ||
|
|
||
| const isConsentRequired = modalState.status === MODAL_STATUS.CONSENT_REQUIRED; | ||
|
|
||
| return ( | ||
| <div className="w3a--relative w3a--flex w3a--flex-col"> | ||
| <div | ||
|
|
@@ -197,7 +208,10 @@ function RootContent(props: RootProps) { | |
| }} | ||
| > | ||
| <div className="w3a--modal-curtain" /> | ||
| <div ref={contentRef} className={twMerge("w3a--relative w3a--flex w3a--flex-col w3a--p-6", isShowLoader ? "w3a--flex-1" : "w3a--flex-none")}> | ||
| <div | ||
| ref={contentRef} | ||
| className={twMerge("w3a--relative w3a--flex w3a--flex-col w3a--p-6", isShowLoader && !isConsentRequired ? "w3a--flex-1" : "w3a--flex-none")} | ||
| > | ||
| {/* Content */} | ||
| {isShowLoader ? ( | ||
| <Loader | ||
|
|
@@ -211,6 +225,10 @@ function RootContent(props: RootProps) { | |
| walletRegistry={walletRegistry} | ||
| handleMobileVerifyConnect={handleMobileVerifyConnect} | ||
| hideSuccessScreen={hideSuccessScreen} | ||
| onAcceptConsent={handleAcceptConsent} | ||
| onDeclineConsent={handleDeclineConsent} | ||
| privacyPolicy={privacyPolicy} | ||
| tncLink={tncLink} | ||
| /> | ||
| ) : ( | ||
| <> | ||
|
|
@@ -237,7 +255,10 @@ function RootContent(props: RootProps) { | |
| )} | ||
|
|
||
| {/* Footer */} | ||
| <Footer privacyPolicy={privacyPolicy} termsOfService={tncLink} /> | ||
| <Footer | ||
| privacyPolicy={!consentRequired && modalState.status !== MODAL_STATUS.CONSENT_REQUIRED ? privacyPolicy : undefined} | ||
| termsOfService={!consentRequired && modalState.status !== MODAL_STATUS.CONSENT_REQUIRED ? tncLink : undefined} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Footer links hidden on all screens when consent enabledMedium Severity When Reviewed by Cursor Bugbot for commit 9006216. Configure here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is intended. we only show privacy and terms links in the footer if consent required is false. |
||
| /> | ||
|
|
||
| <RootBodySheets /> | ||
| </div> | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.