Skip to content

Commit

Permalink
Merge pull request #313 from vietredweb/upgrade-package
Browse files Browse the repository at this point in the history
Upgrade packages
  • Loading branch information
vietredweb authored Oct 3, 2024
2 parents da72506 + 1866c93 commit c5a09f1
Show file tree
Hide file tree
Showing 9 changed files with 3,349 additions and 3,661 deletions.
21 changes: 13 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
"types": "dist/index.d.ts",
"type": "module",
"dependencies": {
"@concordium/browser-wallet-api-helpers": "^3.0.0",
"@concordium/react-components": "^0.4.0-rc.7",
"@concordium/web-sdk": "^7.0.4-rc.3",
"@concordium/browser-wallet-api-helpers": "3.0.1",
"@concordium/react-components": "0.4.0-rc.7",
"@concordium/web-sdk": "7.0.4-rc.3",
"@web3modal/ethereum": "^2.7.0",
"@web3modal/react": "^2.7.0",
"aesirx-sso": "^1.4.17",
"axios": "^1.6.0",
"aesirx-sso": "^1.4.18",
"axios": "^1.7.4",
"bootstrap": "^5.3.2",
"bowser": "^2.11.0",
"buffer": "^6.0.3",
"ethers": "^6.6.5",
"i18next": "^23.6.0",
"i18next-browser-languagedetector": "^7.2.1",
"murmurhash-js": "^1.0.0",
"next": "^14.1.1",
"next": "^14.2.10",
"query-string": "^7.1.1",
"react": "^18.3.1",
"react-bootstrap": "^2.8.0",
Expand Down Expand Up @@ -88,12 +88,17 @@
"react-i18next": "^13.1.2",
"ts-jest": "^29.0.5",
"tsup": "^7.2.0",
"typescript": "^5.0.3"
"typescript": "5.1.6"
},
"files": [
"dist"
],
"resolutions": {
"postcss": "^8"
"postcss": "^8",
"ws": "8.17.1",
"@walletconnect/core": "2.9.1",
"@walletconnect/types": "2.9.1",
"@walletconnect/sign-client": "2.9.1",
"rollup": "3.26.3"
}
}
31 changes: 16 additions & 15 deletions src/Components/ConsentCustom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -863,10 +863,10 @@ const ConsentComponentCustomApp = (props: any) => {
</div>
<div className="p-3 bg-white">
{paymentRevoke
? (window as any)?.aesirx_analytics_translate
?.txt_you_can_revoke_on_the_site ?? t('txt_you_can_revoke_on_the_site')
: (window as any)?.aesirx_analytics_translate?.txt_you_can_revoke ??
t('txt_you_can_revoke')}
? ((window as any)?.aesirx_analytics_translate
?.txt_you_can_revoke_on_the_site ?? t('txt_you_can_revoke_on_the_site'))
: ((window as any)?.aesirx_analytics_translate?.txt_you_can_revoke ??
t('txt_you_can_revoke'))}
</div>
<Form className="mb-0 w-100 bg-white px-3">
<Form.Check
Expand All @@ -891,18 +891,19 @@ const ConsentComponentCustomApp = (props: any) => {
type="checkbox"
label={
item === 'aesirx-analytics-optin-default'
? (window as any)?.aesirx_analytics_translate?.txt_revoke_opt_in ??
t('txt_revoke_opt_in')
? ((window as any)?.aesirx_analytics_translate?.txt_revoke_opt_in ??
t('txt_revoke_opt_in'))
: item === 'aesirx-analytics-optin-payment'
? (window as any)?.aesirx_analytics_translate
?.txt_revoke_opt_in_payment ?? t('txt_revoke_opt_in_payment')
: item === 'aesirx-analytics-optin-advisor'
? (window as any)?.aesirx_analytics_translate
?.txt_revoke_opt_in_advisor ?? t('txt_revoke_opt_in_advisor')
: (window as any)?.aesirx_analytics_translate?.txt_revoke_opt_in ??
t('txt_revoke_opt_in') +
' ' +
item?.replace('aesirx-analytics-optin-', '')
? ((window as any)?.aesirx_analytics_translate
?.txt_revoke_opt_in_payment ?? t('txt_revoke_opt_in_payment'))
: item === 'aesirx-analytics-optin-advisor'
? ((window as any)?.aesirx_analytics_translate
?.txt_revoke_opt_in_advisor ?? t('txt_revoke_opt_in_advisor'))
: ((window as any)?.aesirx_analytics_translate
?.txt_revoke_opt_in ??
t('txt_revoke_opt_in') +
' ' +
item?.replace('aesirx-analytics-optin-', ''))
}
value={item}
onChange={({ target: { value } }) => {
Expand Down
16 changes: 8 additions & 8 deletions src/Components/OptInConsent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ const endpoint =
typeof window !== 'undefined' && window['aesirx1stparty']
? window['aesirx1stparty']
: process?.env?.NEXT_PUBLIC_ENDPOINT_ANALYTICS_URL
? process?.env?.NEXT_PUBLIC_ENDPOINT_ANALYTICS_URL
: process?.env?.REACT_APP_ENDPOINT_ANALYTICS_URL
? process?.env?.REACT_APP_ENDPOINT_ANALYTICS_URL
: '';
? process?.env?.NEXT_PUBLIC_ENDPOINT_ANALYTICS_URL
: process?.env?.REACT_APP_ENDPOINT_ANALYTICS_URL
? process?.env?.REACT_APP_ENDPOINT_ANALYTICS_URL
: '';
const OptInConsent = ({
optInConsentData = window?.optInConsentData ? JSON.parse(window?.optInConsentData) : [],
}: Props) => {
Expand Down Expand Up @@ -149,13 +149,13 @@ const OptInConsent = ({
type="checkbox"
label={
item === 'aesirx-analytics-optin-default'
? (window as any)?.aesirx_analytics_translate
?.txt_revoke_opt_in ?? t('txt_revoke_opt_in')
: (window as any)?.aesirx_analytics_translate
? ((window as any)?.aesirx_analytics_translate
?.txt_revoke_opt_in ?? t('txt_revoke_opt_in'))
: ((window as any)?.aesirx_analytics_translate
?.txt_revoke_opt_in ??
t('txt_revoke_opt_in') +
' ' +
item?.replace('aesirx-analytics-optin-', '')
item?.replace('aesirx-analytics-optin-', ''))
}
value={item}
onChange={({ target: { value } }) => {
Expand Down
16 changes: 8 additions & 8 deletions src/Components/Terms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ const TermsComponent = ({
</p>
<p className="mt-0 mb-1 mb-lg-3">
{layout === 'simple-consent-mode'
? (window as any)?.aesirx_analytics_translate
? ((window as any)?.aesirx_analytics_translate
?.txt_choose_how_we_use_simple ??
t('txt_choose_how_we_use_simple')
: (window as any)?.aesirx_analytics_translate
?.txt_choose_how_we_use ?? t('txt_choose_how_we_use')}
t('txt_choose_how_we_use_simple'))
: ((window as any)?.aesirx_analytics_translate
?.txt_choose_how_we_use ?? t('txt_choose_how_we_use'))}
</p>
<div className="mb-1 mb-lg-3">
<p className="mb-1 mb-lg-2 text-black">
Expand Down Expand Up @@ -329,11 +329,11 @@ const TermsComponent = ({
</p>
<p className="mt-0 mb-1 mb-lg-3">
{layout === 'simple-consent-mode'
? (window as any)?.aesirx_analytics_translate
? ((window as any)?.aesirx_analytics_translate
?.txt_choose_how_we_use_simple ??
t('txt_choose_how_we_use_simple')
: (window as any)?.aesirx_analytics_translate
?.txt_choose_how_we_use ?? t('txt_choose_how_we_use')}
t('txt_choose_how_we_use_simple'))
: ((window as any)?.aesirx_analytics_translate
?.txt_choose_how_we_use ?? t('txt_choose_how_we_use'))}
</p>
<div className="mb-1 mb-lg-3">
<p className="mb-1 mb-lg-2 text-black fw-semibold">
Expand Down
8 changes: 4 additions & 4 deletions src/Hooks/useConsentStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ const useConsentStatus = (endpoint?: string, layout?: string, props?: WalletConn
const revokeTier = !consent?.consent_uuid
? ''
: consent?.web3id && consent?.address
? '4'
: consent?.address && !consent?.web3id
? '3'
: '2';
? '4'
: consent?.address && !consent?.web3id
? '3'
: '2';
if (revokeTier) {
handleRevoke(true, revokeTier);
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/utils/consent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ const agreeConsents = async (
const referer = document.referrer
? document.referrer
: window['referer']
? window['referer'] === '/'
? location.protocol + '//' + location.host
: location.protocol + '//' + location.host + window['referer']
: '';
? window['referer'] === '/'
? location.protocol + '//' + location.host
: location.protocol + '//' + location.host + window['referer']
: '';
const user_agent = window.navigator.userAgent;
const browser = Bowser.parse(window.navigator.userAgent);
const browser_name = browser?.browser?.name;
Expand Down
28 changes: 14 additions & 14 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ const startTracker = async (
referer = referer
? location.protocol + '//' + location.host + referer
: document.referrer
? document.referrer
: window['referer']
? window['referer'] === '/'
? location.protocol + '//' + location.host
: location.protocol + '//' + location.host + window['referer']
: '';
? document.referrer
: window['referer']
? window['referer'] === '/'
? location.protocol + '//' + location.host
: location.protocol + '//' + location.host + window['referer']
: '';
user_agent = window.navigator.userAgent;
const browser = Bowser.parse(window.navigator.userAgent);
const browser_name = browser?.browser?.name;
Expand Down Expand Up @@ -113,12 +113,12 @@ const trackEvent = async (endpoint: string, referer?: string, data?: object) =>
referer = referer
? location.protocol + '//' + location.host + referer
: document.referrer
? document.referrer
: window['referer']
? window['referer'] === '/'
? location.protocol + '//' + location.host
: location.protocol + '//' + location.host + window['referer']
: '';
? document.referrer
: window['referer']
? window['referer'] === '/'
? location.protocol + '//' + location.host
: location.protocol + '//' + location.host + window['referer']
: '';
const url = location.protocol + '//' + location.host + location.pathname;
const user_agent = window.navigator.userAgent;
const browser = Bowser.parse(window.navigator.userAgent);
Expand Down Expand Up @@ -147,8 +147,8 @@ const trackEvent = async (endpoint: string, referer?: string, data?: object) =>
device: device?.includes('iPhone')
? 'mobile'
: device?.includes('iPad')
? 'tablet'
: device,
? 'tablet'
: device,
...data,
}),
],
Expand Down
5 changes: 3 additions & 2 deletions src/utils/woocommerce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ const addToCartAnalytics = () => {
);
singleAddTocartShopList.forEach((item: any) => {
item.addEventListener('click', () => {
const title = item.closest('.product').querySelector('.woocommerce-loop-product__title')
?.innerText;
const title = item
.closest('.product')
.querySelector('.woocommerce-loop-product__title')?.innerText;
if (!item.classList.contains('disabled')) {
trackEventAddToCart(title, item.dataset.product_id, '1');
}
Expand Down
Loading

0 comments on commit c5a09f1

Please sign in to comment.