From 0b4e744d21315fbe5abfdebf98a34bcfe8604a4d Mon Sep 17 00:00:00 2001 From: Viet Date: Fri, 15 Mar 2024 10:13:47 +0700 Subject: [PATCH 01/12] Add ref --- src/Components/ConsentCustom.tsx | 1 + src/analytics.tsx | 1 + src/utils/AnalyticsContextProvider.tsx | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Components/ConsentCustom.tsx b/src/Components/ConsentCustom.tsx index f3de5d9..defdb1c 100644 --- a/src/Components/ConsentCustom.tsx +++ b/src/Components/ConsentCustom.tsx @@ -741,6 +741,7 @@ const ConsentComponentCustomApp = (props: WalletConnectionPropsExtends) => { />
{ setShowExpandConsent(true); sessionStorage.removeItem('aesirx-analytics-rejected'); diff --git a/src/analytics.tsx b/src/analytics.tsx index 5417632..eeb981c 100644 --- a/src/analytics.tsx +++ b/src/analytics.tsx @@ -31,6 +31,7 @@ const ConsentPopup = ({ visitor_uuid, event_uuid }: any) => { visitor_uuid: visitor_uuid, setEventID: undefined, setUUID: undefined, + ref: undefined, }} > diff --git a/src/utils/AnalyticsContextProvider.tsx b/src/utils/AnalyticsContextProvider.tsx index cf4a2f7..b52c103 100644 --- a/src/utils/AnalyticsContextProvider.tsx +++ b/src/utils/AnalyticsContextProvider.tsx @@ -3,7 +3,7 @@ * @license GNU General Public License version 3, see LICENSE. */ -import React, { Dispatch, ReactNode, SetStateAction, useState } from 'react'; +import React, { Dispatch, ReactNode, SetStateAction, useRef, useState } from 'react'; import { appLanguages } from '../translations'; import { AesirXI18nextProvider } from './I18nextProvider'; @@ -16,6 +16,7 @@ interface AnalyticsContextType { visitor_uuid: string; setEventID: Dispatch>; setUUID: Dispatch>; + ref: any; } export const AnalyticsContext = React.createContext({ @@ -23,11 +24,13 @@ export const AnalyticsContext = React.createContext({ visitor_uuid: undefined, setEventID: undefined, setUUID: undefined, + ref: undefined, }); const AnalyticsContextProvider: React.FC = ({ children }) => { const [eventID, setEventID] = useState(); const [UUID, setUUID] = useState(); + const ref = useRef(); return ( = ({ children }) => { visitor_uuid: UUID, setEventID: setEventID, setUUID: setUUID, + ref: ref, }} > {children} From 1af4088bdf7a5080802947ab09433c011843b99c Mon Sep 17 00:00:00 2001 From: Viet Date: Tue, 2 Apr 2024 10:40:50 +0700 Subject: [PATCH 02/12] Fix layout responsive --- src/Components/ConsentCustom.tsx | 10 +++++----- src/Components/Terms.tsx | 16 ++++++++-------- src/styles/style.scss | 10 ++++++++++ 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/Components/ConsentCustom.tsx b/src/Components/ConsentCustom.tsx index defdb1c..2bdeb9d 100644 --- a/src/Components/ConsentCustom.tsx +++ b/src/Components/ConsentCustom.tsx @@ -761,7 +761,7 @@ const ConsentComponentCustomApp = (props: WalletConnectionPropsExtends) => {
{loading === 'done' ? ( <> -

{t('txt_upgrade_consent_text')}

+

{t('txt_upgrade_consent_text')}

{t('txt_your_current_level')}

{ onClick={() => { setUpgradeLayout(true); }} - className="d-flex align-items-center justify-content-center fs-14 w-100 me-3 mb-2 mb-lg-0 rounded-pill py-3 text-dark" + className="d-flex align-items-center justify-content-center fs-14 w-100 me-3 mb-2 mb-lg-0 rounded-pill py-2 py-lg-3 text-dark" > {t('txt_change_consent')} {' '} @@ -909,7 +909,7 @@ const ConsentComponentCustomApp = (props: WalletConnectionPropsExtends) => { }`} > @@ -927,7 +927,7 @@ const ConsentComponentCustomApp = (props: WalletConnectionPropsExtends) => {