Change routing to consume chrome history context.
This commit is contained in:
parent
aa0a21301c
commit
0f89ced2a0
2 changed files with 5 additions and 12 deletions
|
|
@ -1,17 +1,13 @@
|
|||
import React from 'react';
|
||||
|
||||
import { Provider } from 'react-redux';
|
||||
import { BrowserRouter as Router } from 'react-router-dom';
|
||||
|
||||
import App from './App';
|
||||
import { store } from './store';
|
||||
import { getBaseName } from './Utilities/path';
|
||||
|
||||
const ImageBuilder = () => (
|
||||
<Provider store={store}>
|
||||
<Router basename={getBaseName(window.location.pathname)}>
|
||||
<App />
|
||||
</Router>
|
||||
<App />
|
||||
</Provider>
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import React, { lazy } from 'react';
|
|||
import { Route, Routes } from 'react-router-dom';
|
||||
|
||||
import ShareImageModal from './Components/ShareImageModal/ShareImageModal';
|
||||
import { resolveRelPath } from './Utilities/path';
|
||||
|
||||
const LandingPage = lazy(() => import('./Components/LandingPage/LandingPage'));
|
||||
const CreateImageWizard = lazy(() =>
|
||||
|
|
@ -13,12 +12,10 @@ const CreateImageWizard = lazy(() =>
|
|||
export const Router = () => {
|
||||
return (
|
||||
<Routes>
|
||||
<Route
|
||||
path={resolveRelPath('imagewizard/*')}
|
||||
element={<CreateImageWizard />}
|
||||
/>
|
||||
<Route path={resolveRelPath('*')} element={<LandingPage />} />
|
||||
<Route path={resolveRelPath('share/*')} element={<ShareImageModal />} />
|
||||
<Route path="*" element={<LandingPage />}>
|
||||
<Route path="imagewizard/*" element={<CreateImageWizard />} />
|
||||
<Route path="share/*" element={<ShareImageModal />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue