diff --git a/packages/template-retail-react-app/app/components/_app/index.jsx b/packages/template-retail-react-app/app/components/_app/index.jsx index 5b8a2f5545..6dfb4178ea 100644 --- a/packages/template-retail-react-app/app/components/_app/index.jsx +++ b/packages/template-retail-react-app/app/components/_app/index.jsx @@ -19,7 +19,6 @@ import { } from '@salesforce/commerce-sdk-react' import logger from '@salesforce/retail-react-app/app/utils/logger-instance' import {useAppOrigin} from '@salesforce/retail-react-app/app/hooks/use-app-origin' -import loadable from '@loadable/component' // Chakra import { @@ -34,7 +33,6 @@ import {SkipNavLink, SkipNavContent} from '@chakra-ui/skip-nav' // Contexts import {CurrencyProvider} from '@salesforce/retail-react-app/app/contexts' -import {StoreLocatorParamsProvider} from '@salesforce/retail-react-app/app/contexts/store-locator-params' // Local Project Components import Header from '@salesforce/retail-react-app/app/components/header' @@ -81,11 +79,6 @@ import { import Seo from '@salesforce/retail-react-app/app/components/seo' import {getPathWithLocale} from '@salesforce/retail-react-app/app/utils/url' -import useExternalSearch from '@salesforce/retail-react-app/app/hooks/use-external-search' - -const SeInputHandler = loadable(() => - import('@salesforce/retail-react-app/app/components/se-input-handler') -) const PlaceholderComponent = () => (
@@ -133,7 +126,6 @@ const App = (props) => { const {data: categoriesTree} = useCategory({ parameters: {id: CAT_MENU_DEFAULT_ROOT_CATEGORY, levels: CAT_MENU_DEFAULT_NAV_SSR_DEPTH} }) - useExternalSearch() const categories = flatten(categoriesTree || {}, 'categories') const {getTokenWhenReady} = useAccessToken() const appOrigin = useAppOrigin() @@ -153,21 +145,6 @@ const App = (props) => { onClose: onCloseStoreLocator } = useDisclosure() - useEffect(() => { - if (typeof window !== 'undefined' && window.location && window.location.href) { - const href = window.location.href - const questionMarks = (href.match(/\?/g) || []).length - - if (questionMarks > 1) { - const parts = href.split('?') - const fixedUrl = parts[0] + '?' + parts.slice(1).join('&') - const url = new URL(fixedUrl) - const newPath = url.pathname + url.search - history.replace(newPath) - } - } - }, [location, history]) - const targetLocale = getTargetLocale({ getUserPreferredLocales: () => { // CONFIG: This function should return an array of preferred locales. They can be @@ -334,139 +311,125 @@ const App = (props) => { defaultLocale={DEFAULT_LOCALE} > - - - - - - - - - {/* Urls for all localized versions of this page (including current page) - For more details on hrefLang, see https://developers.google.com/search/docs/advanced/crawling/localized-versions */} - {site.l10n?.supportedLocales.map((locale) => ( - - ))} - {/* A general locale as fallback. For example: "en" if default locale is "en-GB" */} + + + + + + + {/* Urls for all localized versions of this page (including current page) + For more details on hrefLang, see https://developers.google.com/search/docs/advanced/crawling/localized-versions */} + {site.l10n?.supportedLocales.map((locale) => ( - {/* A wider fallback for user locales that the app does not support */} - - - - - - - Skip to Content - - - {!isCheckout ? ( - <> - -
- - - - - - - -
- - ) : ( - - )} -
- {!isOnline && } - - - + {/* A wider fallback for user locales that the app does not support */} + +
+ + + + + Skip to Content + + + {!isCheckout ? ( + <> + +
- - {children} - - - - - {!isCheckout ?
: } - - - - + + + + + + + +
+ + ) : ( + + )}
-
+ {!isOnline && } + + + + + {children} + + + + + {!isCheckout ?