mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Change prettier rules
This commit is contained in:
@@ -10,24 +10,19 @@ import { ComponentLoader } from 'app/components/ui/loader';
|
||||
import ContextProvider from './ContextProvider';
|
||||
|
||||
const SuccessOauthPage = React.lazy(() =>
|
||||
import(
|
||||
/* webpackChunkName: "page-oauth-success" */ 'app/pages/auth/SuccessOauthPage'
|
||||
),
|
||||
import(/* webpackChunkName: "page-oauth-success" */ 'app/pages/auth/SuccessOauthPage'),
|
||||
);
|
||||
|
||||
const App = ({ store, history }: { store: Store; history: History<any> }) => (
|
||||
<ContextProvider store={store} history={history}>
|
||||
<React.Suspense fallback={<ComponentLoader />}>
|
||||
<Switch>
|
||||
<Route path="/oauth2/code/success" component={SuccessOauthPage} />
|
||||
<AuthFlowRoute
|
||||
path="/oauth2/:version(v\d+)/:clientId?"
|
||||
component={() => null}
|
||||
/>
|
||||
<Route path="/" component={RootPage} />
|
||||
</Switch>
|
||||
</React.Suspense>
|
||||
</ContextProvider>
|
||||
<ContextProvider store={store} history={history}>
|
||||
<React.Suspense fallback={<ComponentLoader />}>
|
||||
<Switch>
|
||||
<Route path="/oauth2/code/success" component={SuccessOauthPage} />
|
||||
<AuthFlowRoute path="/oauth2/:version(v\d+)/:clientId?" component={() => null} />
|
||||
<Route path="/" component={RootPage} />
|
||||
</Switch>
|
||||
</React.Suspense>
|
||||
</ContextProvider>
|
||||
);
|
||||
|
||||
export default hot(App);
|
||||
|
@@ -5,24 +5,16 @@ import { HelmetProvider } from 'react-helmet-async';
|
||||
import { IntlProvider } from 'app/components/i18n';
|
||||
import { Store } from 'app/reducers';
|
||||
|
||||
function ContextProvider({
|
||||
children,
|
||||
store,
|
||||
history,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
store: Store;
|
||||
history: any;
|
||||
}) {
|
||||
return (
|
||||
<HelmetProvider>
|
||||
<ReduxProvider store={store}>
|
||||
<IntlProvider>
|
||||
<Router history={history}>{children}</Router>
|
||||
</IntlProvider>
|
||||
</ReduxProvider>
|
||||
</HelmetProvider>
|
||||
);
|
||||
function ContextProvider({ children, store, history }: { children: React.ReactNode; store: Store; history: any }) {
|
||||
return (
|
||||
<HelmetProvider>
|
||||
<ReduxProvider store={store}>
|
||||
<IntlProvider>
|
||||
<Router history={history}>{children}</Router>
|
||||
</IntlProvider>
|
||||
</ReduxProvider>
|
||||
</HelmetProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default ContextProvider;
|
||||
|
@@ -6,13 +6,11 @@ import ContextProvider from './ContextProvider';
|
||||
|
||||
type ContextProps = React.ComponentProps<typeof ContextProvider>;
|
||||
|
||||
function TestContextProvider(
|
||||
props: Partial<ContextProps> & { children: ContextProps['children'] },
|
||||
) {
|
||||
const store = React.useMemo(storeFactory, []);
|
||||
const history = React.useMemo(createMemoryHistory, []);
|
||||
function TestContextProvider(props: Partial<ContextProps> & { children: ContextProps['children'] }) {
|
||||
const store = React.useMemo(storeFactory, []);
|
||||
const history = React.useMemo(createMemoryHistory, []);
|
||||
|
||||
return <ContextProvider store={store} history={history} {...props} />;
|
||||
return <ContextProvider store={store} history={history} {...props} />;
|
||||
}
|
||||
|
||||
export default TestContextProvider;
|
||||
|
Reference in New Issue
Block a user