This repository has been archived by the owner on Dec 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(front): retrieve main loading animation (#7587)
* fix(front): retrieve main loading animation * fix history paramas in legacyRoute
- Loading branch information
Showing
4 changed files
with
29 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import { Switch, Route, withRouter } from 'react-router-dom'; | ||
import ReactRouter from '../reactRouter'; | ||
import LegacyRoute from '../../route-components/legacyRoute'; | ||
|
||
// main router to handle switch between legacy routes and react pages | ||
// legacy route has a key to make it fully uncontrolled | ||
// (https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#recommendation-fully-uncontrolled-component-with-a-key) | ||
// it allows to reconstruct the component to display loading animation | ||
const MainRouter = ({ history: { location: { key } } }) => ( | ||
<Switch> | ||
<Route key={`path-${key}`} path="/main.php" exact component={LegacyRoute}/> | ||
<Route path='/' exact render={() => (<Redirect to='/main.php'/>)}/> | ||
<Route path='/' component={ReactRouter}/> | ||
</Switch> | ||
); | ||
|
||
export default withRouter(MainRouter); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.