forked from binary-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.
- Loading branch information
1 parent
ecbb7fd
commit e4b6d83
Showing
5 changed files
with
48 additions
and
46 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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
export BinaryLink from './binary-link.jsx'; | ||
export default from './binary-routes.jsx'; | ||
import BinaryLink from './binary-link'; | ||
import RouteWithSubRoutes from './route-with-sub-routes'; | ||
import BinaryRoutes from './binary-routes'; | ||
|
||
export * from './helpers'; | ||
export RouteWithSubRoutes from './route-with-sub-routes.jsx'; | ||
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,40 @@ | ||
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 RootStore from 'Stores/index'; | ||
import { TErrorComponent } from 'Components/Errors/error-component'; | ||
|
||
type TPassthrough = { | ||
root_store: RootStore; | ||
WS: Record<string, any>; | ||
}; | ||
|
||
type TRoutes = { | ||
error?: TErrorComponent; | ||
has_error?: boolean; | ||
is_logged_in?: boolean; | ||
is_logging_in?: boolean; | ||
is_virtual?: boolean; | ||
passthrough?: TPassthrough; | ||
}; | ||
|
||
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 }: RootStore) => ({ | ||
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