Merge branch 'develop' into 'main'
compatibility-v2 See merge request witapp/aura-webapp!663
This commit is contained in:
commit
743e785ad3
@ -25,6 +25,7 @@ import Clarity from '@microsoft/clarity';
|
|||||||
import { InitializationProvider } from "./initialization";
|
import { InitializationProvider } from "./initialization";
|
||||||
import HeadDataPalmDomen from "./utils/HelmetPalm";
|
import HeadDataPalmDomen from "./utils/HelmetPalm";
|
||||||
import HeadDataCompatibilityDomen from "./utils/HelmetComp";
|
import HeadDataCompatibilityDomen from "./utils/HelmetComp";
|
||||||
|
import HeadDataCompatibilityDomen1 from "./utils/HelmetComp1";
|
||||||
|
|
||||||
pdfjs.GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@${pdfjs.version}/legacy/build/pdf.worker.min.js`;
|
pdfjs.GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@${pdfjs.version}/legacy/build/pdf.worker.min.js`;
|
||||||
|
|
||||||
@ -93,6 +94,7 @@ const init = async () => {
|
|||||||
{isProduction && window.location.hostname === "aura.witapps.us" && <HeadData />}
|
{isProduction && window.location.hostname === "aura.witapps.us" && <HeadData />}
|
||||||
{isProduction && window.location.hostname === "aurastellar.us" && <HeadDataPalmDomen />}
|
{isProduction && window.location.hostname === "aurastellar.us" && <HeadDataPalmDomen />}
|
||||||
{isProduction && window.location.hostname === "auraself.com" && <HeadDataCompatibilityDomen />}
|
{isProduction && window.location.hostname === "auraself.com" && <HeadDataCompatibilityDomen />}
|
||||||
|
{isProduction && window.location.hostname === "astralaura.us" && <HeadDataCompatibilityDomen1 />}
|
||||||
<I18nextProvider i18n={i18nextInstance}>
|
<I18nextProvider i18n={i18nextInstance}>
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { language } from "@/locales";
|
import { getDefaultLocaleByLanguage, language } from "@/locales";
|
||||||
import { compatibilityV2Prefix } from "@/routes";
|
import { compatibilityV2Prefix } from "@/routes";
|
||||||
import { Helmet } from "react-helmet";
|
import { Helmet } from "react-helmet";
|
||||||
|
|
||||||
@ -16,6 +16,7 @@ const isRouteInclude = (url: string, routes: string[]) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const HeadDataCompatibilityDomen = () => {
|
const HeadDataCompatibilityDomen = () => {
|
||||||
|
const locale = getDefaultLocaleByLanguage(language);
|
||||||
const isCompatibility = isRouteInclude(window.location.pathname, routesCompatibility2);
|
const isCompatibility = isRouteInclude(window.location.pathname, routesCompatibility2);
|
||||||
|
|
||||||
// Compatibility
|
// Compatibility
|
||||||
@ -31,12 +32,27 @@ s.parentNode.insertBefore(t,s)}(window, document,'script',
|
|||||||
fbq('init', '567196172967340');
|
fbq('init', '567196172967340');
|
||||||
fbq('track', 'PageView');`;
|
fbq('track', 'PageView');`;
|
||||||
|
|
||||||
|
const FBScriptCompatibilityPT1 = `
|
||||||
|
!function(f,b,e,v,n,t,s)
|
||||||
|
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
||||||
|
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
|
||||||
|
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
|
||||||
|
n.queue=[];t=b.createElement(e);t.async=!0;
|
||||||
|
t.src=v;s=b.getElementsByTagName(e)[0];
|
||||||
|
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
||||||
|
'https://connect.facebook.net/en_US/fbevents.js');
|
||||||
|
fbq('init', '567469913004428');
|
||||||
|
fbq('track', 'PageView');`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Helmet htmlAttributes={{ lang: language }}>
|
<Helmet htmlAttributes={{ lang: language }}>
|
||||||
{/* Compatibility */}
|
{/* Compatibility */}
|
||||||
{isCompatibility && (
|
{isCompatibility && (
|
||||||
<script>{FBScriptCompatibility}</script>
|
<script>{FBScriptCompatibility}</script>
|
||||||
)}
|
)}
|
||||||
|
{isCompatibility && locale?.includes("pt") && (
|
||||||
|
<script>{FBScriptCompatibilityPT1}</script>
|
||||||
|
)}
|
||||||
</Helmet>
|
</Helmet>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
48
src/utils/HelmetComp1/index.tsx
Normal file
48
src/utils/HelmetComp1/index.tsx
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
import { getDefaultLocaleByLanguage, language } from "@/locales";
|
||||||
|
import { compatibilityV2Prefix } from "@/routes";
|
||||||
|
import { Helmet } from "react-helmet";
|
||||||
|
|
||||||
|
const routesCompatibility2 = [
|
||||||
|
compatibilityV2Prefix
|
||||||
|
]
|
||||||
|
|
||||||
|
const isRouteInclude = (url: string, routes: string[]) => {
|
||||||
|
for (const route of routes) {
|
||||||
|
if (url.includes(route)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
const HeadDataCompatibilityDomen1 = () => {
|
||||||
|
const locale = getDefaultLocaleByLanguage(language);
|
||||||
|
const isCompatibility = isRouteInclude(window.location.pathname, routesCompatibility2);
|
||||||
|
|
||||||
|
// Compatibility
|
||||||
|
const FBScriptCompatibilityES = `
|
||||||
|
!function(f,b,e,v,n,t,s)
|
||||||
|
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
||||||
|
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
|
||||||
|
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
|
||||||
|
n.queue=[];t=b.createElement(e);t.async=!0;
|
||||||
|
t.src=v;s=b.getElementsByTagName(e)[0];
|
||||||
|
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
||||||
|
'https://connect.facebook.net/en_US/fbevents.js');
|
||||||
|
fbq('init', '621741563825195');
|
||||||
|
fbq('track', 'PageView');`;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Helmet htmlAttributes={{ lang: language }}>
|
||||||
|
{/* Compatibility */}
|
||||||
|
{isCompatibility && locale === "es" && (
|
||||||
|
<script>{FBScriptCompatibilityES}</script>
|
||||||
|
)}
|
||||||
|
{isCompatibility && locale === "es-419" && (
|
||||||
|
<script>{FBScriptCompatibilityES}</script>
|
||||||
|
)}
|
||||||
|
</Helmet>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default HeadDataCompatibilityDomen1;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { language } from "@/locales";
|
import { getDefaultLocaleByLanguage, language } from "@/locales";
|
||||||
import { palmistryV1Prefix } from "@/routes";
|
import { palmistryV1Prefix } from "@/routes";
|
||||||
import { Helmet } from "react-helmet";
|
import { Helmet } from "react-helmet";
|
||||||
|
|
||||||
@ -20,6 +20,7 @@ const isRouteInclude = (url: string, routes: string[]) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const HeadDataPalmDomen = () => {
|
const HeadDataPalmDomen = () => {
|
||||||
|
const locale = getDefaultLocaleByLanguage(language);
|
||||||
const isPalmistry = isRouteInclude(window.location.pathname, routesPalmistry);
|
const isPalmistry = isRouteInclude(window.location.pathname, routesPalmistry);
|
||||||
|
|
||||||
// Palmistry
|
// Palmistry
|
||||||
@ -35,10 +36,25 @@ s.parentNode.insertBefore(t,s)}(window, document,'script',
|
|||||||
fbq('init', '9251222678332693');
|
fbq('init', '9251222678332693');
|
||||||
fbq('track', 'PageView');`;
|
fbq('track', 'PageView');`;
|
||||||
|
|
||||||
|
const FBScriptPalmistryPT1 = `
|
||||||
|
!function(f,b,e,v,n,t,s)
|
||||||
|
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
||||||
|
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
|
||||||
|
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
|
||||||
|
n.queue=[];t=b.createElement(e);t.async=!0;
|
||||||
|
t.src=v;s=b.getElementsByTagName(e)[0];
|
||||||
|
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
||||||
|
'https://connect.facebook.net/en_US/fbevents.js');
|
||||||
|
fbq('init', '1294757145123988');
|
||||||
|
fbq('track', 'PageView');`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Helmet htmlAttributes={{ lang: language }}>
|
<Helmet htmlAttributes={{ lang: language }}>
|
||||||
{/* Palmistry */}
|
{/* Palmistry */}
|
||||||
{isPalmistry && <script>{FBScriptPalmistry1}</script>}
|
{isPalmistry && <script>{FBScriptPalmistry1}</script>}
|
||||||
|
{isPalmistry && locale?.includes("pt") && (
|
||||||
|
<script>{FBScriptPalmistryPT1}</script>
|
||||||
|
)}
|
||||||
</Helmet>
|
</Helmet>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user