|
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; |
|
|
import { Provider as ReduxProvider } from 'react-redux'; |
|
|
import CalypsoI18nProvider from 'calypso/components/calypso-i18n-provider'; |
|
|
import { RouteProvider } from 'calypso/components/route'; |
|
|
import LayoutLoggedOut from 'calypso/layout/logged-out'; |
|
|
import { makeLayoutMiddleware } from './shared.js'; |
|
|
import { ssrSetupLocaleMiddleware } from './ssr-setup-locale.js'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export { setSectionMiddleware, setLocaleMiddleware } from './shared.js'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ProviderWrappedLoggedOutLayout = ( { |
|
|
store, |
|
|
queryClient = new QueryClient(), |
|
|
currentSection, |
|
|
currentRoute, |
|
|
currentQuery, |
|
|
primary, |
|
|
secondary, |
|
|
renderHeaderSection, |
|
|
redirectUri, |
|
|
i18n, |
|
|
showGdprBanner, |
|
|
} ) => ( |
|
|
<CalypsoI18nProvider i18n={ i18n }> |
|
|
<RouteProvider |
|
|
currentSection={ currentSection } |
|
|
currentRoute={ currentRoute } |
|
|
currentQuery={ currentQuery } |
|
|
> |
|
|
<QueryClientProvider client={ queryClient }> |
|
|
<ReduxProvider store={ store }> |
|
|
<LayoutLoggedOut |
|
|
primary={ primary } |
|
|
secondary={ secondary } |
|
|
renderHeaderSection={ renderHeaderSection } |
|
|
redirectUri={ redirectUri } |
|
|
showGdprBanner={ showGdprBanner } |
|
|
/> |
|
|
</ReduxProvider> |
|
|
</QueryClientProvider> |
|
|
</RouteProvider> |
|
|
</CalypsoI18nProvider> |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const makeLayout = makeLayoutMiddleware( ProviderWrappedLoggedOutLayout ); |
|
|
|
|
|
export const ssrSetupLocale = ssrSetupLocaleMiddleware(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const redirectWithoutLocaleParamInFrontIfLoggedIn = () => {}; |
|
|
export const redirectInvalidLanguage = () => {}; |
|
|
export const redirectLoggedOut = () => {}; |
|
|
export const redirectLoggedOutToSignup = () => {}; |
|
|
export const redirectToDashboard = () => {}; |
|
|
export const redirectMyJetpack = () => {}; |
|
|
export const redirectWithoutLocaleParamIfLoggedIn = () => {}; |
|
|
|
|
|
export const redirectIfCurrentUserCannot = ( capability ) => () => {}; |
|
|
export const redirectIfP2 = () => {}; |
|
|
export const redirectIfJetpackNonAtomic = () => {}; |
|
|
export const redirectToHostingPromoIfNotAtomic = () => {}; |
|
|
|
|
|
export const render = ( context ) => {}; |
|
|
export const ProviderWrappedLayout = () => null; |
|
|
export const notFound = () => null; |
|
|
export const setSelectedSiteIdByOrigin = () => {}; |
|
|
|
|
|
export const redirectIfDuplicatedView = ( wpAdminPath ) => () => {}; |
|
|
|