Merged in feat/LOY-484-consent-alert (pull request #3184)

feat(LOY-484): Change toast to alert for Profiling Consent

* feat(LOY-484): change toast to alert using context

* refactor(LOY-484): remove uneccesary code

* chore(LOY-484): small UI fixes


Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
Matilda Landström
2025-11-26 12:13:04 +00:00
parent 086319e8b1
commit 26f3b5bdd0
6 changed files with 173 additions and 38 deletions

View File

@@ -6,6 +6,8 @@ import {
getProfilingConsent,
} from "@/lib/trpc/memoizedRequests"
import ProfilingConsentAlert from "@/components/MyPages/ProfilingConsent/Alert"
import { ProfilingConsentAlertProvider } from "@/components/MyPages/ProfilingConsent/Alert/AlertContext"
import ProfilingConsentModal from "@/components/MyPages/ProfilingConsent/Modal"
import { userHasConsent } from "@/components/MyPages/ProfilingConsent/utils"
import { SASLevelUpgradeCheck } from "@/components/MyPages/SASLevelUpgradeCheck"
@@ -36,24 +38,32 @@ export default async function MyPagesLayout({
const lang = await getLang()
return (
<div className={styles.container}>
<div className={styles.layout}>
{breadcrumbs}
<div className={styles.content}>{children}</div>
</div>
<ProfilingConsentAlertProvider>
<div className={styles.container}>
<div className={styles.layout}>
{breadcrumbs}
{eurobonusMembership && <SASLevelUpgradeCheck />}
<Surprises />
{memberKey && profilingConsent && !hasConsent ? (
<>
<ProfilingConsentModal
memberKey={memberKey}
content={profilingConsent.modal}
iconIdentifier={profilingConsent.icon}
/>
<TrackingSDK pageData={{ domainLanguage: lang, ...ModalTracking }} />
</>
) : null}
</div>
<div className={styles.content}>
<ProfilingConsentAlert />
{children}
</div>
</div>
{eurobonusMembership && <SASLevelUpgradeCheck />}
<Surprises />
{memberKey && profilingConsent && !hasConsent ? (
<>
<ProfilingConsentModal
memberKey={memberKey}
content={profilingConsent.modal}
iconIdentifier={profilingConsent.icon}
/>
<TrackingSDK
pageData={{ domainLanguage: lang, ...ModalTracking }}
/>
</>
) : null}
</div>
</ProfilingConsentAlertProvider>
)
}