diff --git a/README.md b/README.md index 00da483..be29f95 100644 --- a/README.md +++ b/README.md @@ -286,13 +286,10 @@ Please follow below CSS example: ## Choose template for Consent modal There is 5 template for Consent modal -1. original -2. default (recommend) -3. simple-consent-mode - 1. Support Basic Consent Mode v2 -4. advance-consent-mode +1. default (recommend) 1. Support Advance Consent Mode v2 -5. simple-web-2 +2. simple-consent-mode + 1. Support Basic Consent Mode v2 #### Usage in SSR site: ``` @@ -325,7 +322,10 @@ NEXT_PUBLIC_CONSENT_LAYOUT=default "title":"payment", "content":"
- {t('txt_manage_your_consent')} -
-- {layout === 'simple-consent-mode' - ? t('txt_choose_how_we_use_simple') - : t('txt_choose_how_we_use')} -
-{t('txt_by_consenting')}
-{t('txt_please_note')}
-+ {t('txt_manage_your_consent')} +
++ {layout === 'simple-consent-mode' + ? t('txt_choose_how_we_use_simple') + : t('txt_choose_how_we_use')} +
++ {t('txt_by_consenting')} +
+{t('txt_please_note')}
+{t('txt_manage_your_consent')} @@ -350,7 +366,7 @@ const TermsComponent = ({
{t('txt_our_commitment_in_action')}
diff --git a/src/Hooks/useConsentStatus.ts b/src/Hooks/useConsentStatus.ts
index 9c0a5d5..30b7444 100644
--- a/src/Hooks/useConsentStatus.ts
+++ b/src/Hooks/useConsentStatus.ts
@@ -84,7 +84,7 @@ const useConsentStatus = (endpoint?: string, layout?: string, props?: WalletConn
const rpc = useGrpcClient(network);
useEffect(() => {
- if (rpc && layout !== 'simple-consent-mode' && layout !== 'simple-web-2' && level !== 1) {
+ if (rpc && layout !== 'simple-consent-mode' && level !== 1) {
setRpcGenesisHash(undefined);
rpc
.getConsensusStatus()
@@ -134,7 +134,7 @@ const useConsentStatus = (endpoint?: string, layout?: string, props?: WalletConn
const handleLevel = useCallback(
async (_level: number) => {
- if (layout !== 'simple-consent-mode' && layout !== 'simple-web-2') {
+ if (layout !== 'simple-consent-mode') {
setLevel(_level);
if (_level > 3 && isDesktop && !connection && window['concordium']) {
setActiveConnectorType(BROWSER_WALLET);
diff --git a/src/analytics.tsx b/src/analytics.tsx
index 92bf8e4..5ee88dd 100644
--- a/src/analytics.tsx
+++ b/src/analytics.tsx
@@ -27,9 +27,10 @@ declare global {
}
const ConsentPopup = ({ visitor_uuid, event_uuid }: any) => {
window.process = { env: '' };
- const [layout, setLayout] = useState(window['consentLayout'] ?? 'simple-web-2');
+ const [layout, setLayout] = useState(window['consentLayout'] ?? 'simple-consent-mode');
const [gtagId, setGtagId] = useState(window['analyticsGtagId']);
const [gtmId, setGtmId] = useState(window['analyticsGtmId']);
+ const [customConsentText, setCustomConsentText] = useState(window['analyticsConsentText']);
useEffect(() => {
const init = async () => {
const data: any = await getConsentTemplate(
@@ -39,6 +40,7 @@ const ConsentPopup = ({ visitor_uuid, event_uuid }: any) => {
setLayout(data?.data?.template ?? window['consentLayout']);
setGtagId(data?.data?.gtag_id ?? window['analyticsGtagId']);
setGtmId(data?.data?.gtm_id ?? window['analyticsGtmId']);
+ setCustomConsentText(data?.data?.consent_text ?? window['analyticsConsentText']);
};
init();
}, []);
@@ -60,6 +62,7 @@ const ConsentPopup = ({ visitor_uuid, event_uuid }: any) => {
aesirXEndpoint={window['aesirxEndpoint'] ?? 'https://api.aesirx.io'}
gtagId={gtagId}
gtmId={gtmId}
+ customConsentText={customConsentText}
/>
) : (