diff options
author | muhamedsalih-tw <104364298+muhamedsalih-tw@users.noreply.github.com> | 2022-10-25 12:51:28 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-25 07:21:28 +0000 |
commit | f79727a8632490f11c1423773fdd6adfb6337a7b (patch) | |
tree | a80943f4e4e571359c8104341a3957f6e763dce4 /src/routes.tsx | |
parent | add balajiv113 as a contributor for code (#701) [skip ci] (diff) | |
download | ferdium-app-f79727a8632490f11c1423773fdd6adfb6337a7b.tar.gz ferdium-app-f79727a8632490f11c1423773fdd6adfb6337a7b.tar.zst ferdium-app-f79727a8632490f11c1423773fdd6adfb6337a7b.zip |
Transform 'AuthLayoutContainer' component hierarchy to tsx (#699)
Co-authored-by: Muhamed <>
Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
Diffstat (limited to 'src/routes.tsx')
-rw-r--r-- | src/routes.tsx | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/src/routes.tsx b/src/routes.tsx index 478d3dfe8..8150d135e 100644 --- a/src/routes.tsx +++ b/src/routes.tsx | |||
@@ -6,7 +6,7 @@ import { | |||
6 | Routes, | 6 | Routes, |
7 | unstable_HistoryRouter as HistoryRouter, | 7 | unstable_HistoryRouter as HistoryRouter, |
8 | } from 'react-router-dom'; | 8 | } from 'react-router-dom'; |
9 | 9 | import { HashHistory } from 'history'; | |
10 | import AppLayoutContainer from './containers/layout/AppLayoutContainer'; | 10 | import AppLayoutContainer from './containers/layout/AppLayoutContainer'; |
11 | import SettingsWindow from './containers/settings/SettingsWindow'; | 11 | import SettingsWindow from './containers/settings/SettingsWindow'; |
12 | import ReleaseNotesWindow from './containers/settings/ReleaseNotesWindow'; | 12 | import ReleaseNotesWindow from './containers/settings/ReleaseNotesWindow'; |
@@ -33,25 +33,19 @@ import AuthLayoutContainer from './containers/auth/AuthLayoutContainer'; | |||
33 | import WorkspacesScreen from './features/workspaces/containers/WorkspacesScreen'; | 33 | import WorkspacesScreen from './features/workspaces/containers/WorkspacesScreen'; |
34 | import EditWorkspaceScreen from './features/workspaces/containers/EditWorkspaceScreen'; | 34 | import EditWorkspaceScreen from './features/workspaces/containers/EditWorkspaceScreen'; |
35 | import { WORKSPACES_ROUTES } from './features/workspaces/constants'; | 35 | import { WORKSPACES_ROUTES } from './features/workspaces/constants'; |
36 | import { Actions } from './actions/lib/actions'; | 36 | import { StoresProps } from './@types/ferdium-components.types'; |
37 | import { RealStores } from './stores'; | ||
38 | 37 | ||
39 | type Props = { | 38 | interface IProps extends StoresProps { |
40 | stores: RealStores; | 39 | history: HashHistory; |
41 | actions: Actions; | 40 | } |
42 | history: any; | ||
43 | }; | ||
44 | 41 | ||
45 | class FerdiumRoutes extends Component<Props> { | 42 | @inject('stores', 'actions') |
43 | @observer | ||
44 | class FerdiumRoutes extends Component<IProps> { | ||
46 | render(): ReactElement { | 45 | render(): ReactElement { |
47 | const { history } = this.props; | 46 | const { history, stores, actions } = this.props; |
48 | const routeProps = { | 47 | const routeProps: StoresProps = { stores, actions }; |
49 | stores: this.props.stores, | 48 | const errorProps = { error: this.props.stores.globalError.error || {} }; |
50 | actions: this.props.actions, | ||
51 | }; | ||
52 | const errorProps = { | ||
53 | error: this.props.stores.globalError.error || {}, | ||
54 | }; | ||
55 | 49 | ||
56 | return ( | 50 | return ( |
57 | <HistoryRouter history={history}> | 51 | <HistoryRouter history={history}> |
@@ -185,4 +179,4 @@ class FerdiumRoutes extends Component<Props> { | |||
185 | } | 179 | } |
186 | } | 180 | } |
187 | 181 | ||
188 | export default inject('stores', 'actions')(observer(FerdiumRoutes)); | 182 | export default FerdiumRoutes; |