Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {ChakraProvider} from '@salesforce/retail-react-app/app/components/shared
import 'focus-visible/dist/focus-visible'

import theme from '@salesforce/retail-react-app/app/theme'
import {MultiSiteProvider} from '@salesforce/retail-react-app/app/contexts'
import {MultiSiteProvider, StoreLocatorProvider} from '@salesforce/retail-react-app/app/contexts'
import {useAppOrigin} from '@salesforce/retail-react-app/app/hooks/use-app-origin'
import {
resolveSiteFromUrl,
Expand All @@ -35,7 +35,17 @@ import {CommerceApiProvider} from '@salesforce/commerce-sdk-react'
import {withReactQuery} from '@salesforce/pwa-kit-react-sdk/ssr/universal/components/with-react-query'
import {useCorrelationId} from '@salesforce/pwa-kit-react-sdk/ssr/universal/hooks'
import {ReactQueryDevtools} from '@tanstack/react-query-devtools'
import {DEFAULT_DNT_STATE} from '@salesforce/retail-react-app/app/constants'
import {
DEFAULT_DNT_STATE,
STORE_LOCATOR_RADIUS,
STORE_LOCATOR_RADIUS_UNIT,
STORE_LOCATOR_DEFAULT_COUNTRY,
STORE_LOCATOR_DEFAULT_COUNTRY_CODE,
STORE_LOCATOR_DEFAULT_POSTAL_CODE,
STORE_LOCATOR_DEFAULT_PAGE_SIZE,
STORE_LOCATOR_SUPPORTED_COUNTRIES
} from '@salesforce/retail-react-app/app/constants'

/**
* Use the AppConfig component to inject extra arguments into the getProps
* methods for all Route Components in the app – typically you'd want to do this
Expand All @@ -56,6 +66,16 @@ const AppConfig = ({children, locals = {}}) => {

const passwordlessCallback = locals.appConfig.login?.passwordless?.callbackURI

const storeLocatorConfig = {
radius: STORE_LOCATOR_RADIUS,
radiusUnit: STORE_LOCATOR_RADIUS_UNIT,
defaultCountry: STORE_LOCATOR_DEFAULT_COUNTRY,
defaultCountryCode: STORE_LOCATOR_DEFAULT_COUNTRY_CODE,
defaultPostalCode: STORE_LOCATOR_DEFAULT_POSTAL_CODE,
defaultPageSize: STORE_LOCATOR_DEFAULT_PAGE_SIZE,
supportedCountries: STORE_LOCATOR_SUPPORTED_COUNTRIES
}

return (
<CommerceApiProvider
shortCode={commerceApiConfig.parameters.shortCode}
Expand All @@ -75,7 +95,9 @@ const AppConfig = ({children, locals = {}}) => {
logger={createLogger({packageName: 'commerce-sdk-react'})}
>
<MultiSiteProvider site={locals.site} locale={locals.locale} buildUrl={locals.buildUrl}>
<ChakraProvider theme={theme}>{children}</ChakraProvider>
<StoreLocatorProvider config={storeLocatorConfig}>
<ChakraProvider theme={theme}>{children}</ChakraProvider>
</StoreLocatorProvider>
</MultiSiteProvider>
<ReactQueryDevtools />
</CommerceApiProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import {DrawerMenu} from '@salesforce/retail-react-app/app/components/drawer-men
import {ListMenu, ListMenuContent} from '@salesforce/retail-react-app/app/components/list-menu'
import {HideOnDesktop, HideOnMobile} from '@salesforce/retail-react-app/app/components/responsive'
import AboveHeader from '@salesforce/retail-react-app/app/components/_app/partials/above-header'
import StoreLocatorModal from '@salesforce/retail-react-app/app/components/store-locator-modal'
import {StoreLocatorModal} from '@salesforce/retail-react-app/app/components/store-locator'
// Hooks
import {AuthModal, useAuthModal} from '@salesforce/retail-react-app/app/hooks/use-auth-modal'
import {
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading