forked from deriv-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sergei / chore: ts migration of routes (#38)
* chore: ts migration of routes * chore: change RootStore type
- Loading branch information
1 parent
de6d33c
commit 193d2a7
Showing
6 changed files
with
54 additions
and
52 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,7 @@ | ||
import BinaryLink from './binary-link'; | ||
import RouteWithSubRoutes from './route-with-sub-routes'; | ||
import BinaryRoutes from './binary-routes'; | ||
|
||
export * from './helpers'; | ||
export { BinaryLink, RouteWithSubRoutes }; | ||
export default BinaryRoutes; |
This file was deleted.
Oops, something went wrong.
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,26 @@ | ||
import React from 'react'; | ||
import { withRouter } from 'react-router'; | ||
import BinaryRoutes from 'Components/Routes'; | ||
import { connect } from 'Stores/connect'; | ||
import ErrorComponent from 'Components/Errors'; | ||
import { TRootStore } from 'Stores/index'; | ||
import { TRoutes } from '../Types'; | ||
|
||
const Routes = ({ error, has_error, is_logged_in, is_logging_in, is_virtual, passthrough }: TRoutes) => { | ||
if (has_error) { | ||
return <ErrorComponent {...error} />; | ||
} | ||
|
||
return <BinaryRoutes is_logged_in={is_logged_in} is_logging_in={is_logging_in} passthrough={passthrough} />; | ||
}; | ||
|
||
// need to wrap withRouter around connect | ||
// to prevent updates on <BinaryRoutes /> from being blocked | ||
export default withRouter( | ||
connect(({ client, common }: TRootStore) => ({ | ||
is_logged_in: client.is_logged_in, | ||
is_logging_in: client.is_logging_in, | ||
error: common.error, | ||
has_error: common.has_error, | ||
}))(Routes) | ||
); |
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