aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes.tsx
diff options
context:
space:
mode:
authorLibravatar muhamedsalih-tw <104364298+muhamedsalih-tw@users.noreply.github.com>2022-10-25 12:51:28 +0530
committerLibravatar GitHub <noreply@github.com>2022-10-25 07:21:28 +0000
commitf79727a8632490f11c1423773fdd6adfb6337a7b (patch)
treea80943f4e4e571359c8104341a3957f6e763dce4 /src/routes.tsx
parentadd balajiv113 as a contributor for code (#701) [skip ci] (diff)
downloadferdium-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.tsx30
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 9import { HashHistory } from 'history';
10import AppLayoutContainer from './containers/layout/AppLayoutContainer'; 10import AppLayoutContainer from './containers/layout/AppLayoutContainer';
11import SettingsWindow from './containers/settings/SettingsWindow'; 11import SettingsWindow from './containers/settings/SettingsWindow';
12import ReleaseNotesWindow from './containers/settings/ReleaseNotesWindow'; 12import ReleaseNotesWindow from './containers/settings/ReleaseNotesWindow';
@@ -33,25 +33,19 @@ import AuthLayoutContainer from './containers/auth/AuthLayoutContainer';
33import WorkspacesScreen from './features/workspaces/containers/WorkspacesScreen'; 33import WorkspacesScreen from './features/workspaces/containers/WorkspacesScreen';
34import EditWorkspaceScreen from './features/workspaces/containers/EditWorkspaceScreen'; 34import EditWorkspaceScreen from './features/workspaces/containers/EditWorkspaceScreen';
35import { WORKSPACES_ROUTES } from './features/workspaces/constants'; 35import { WORKSPACES_ROUTES } from './features/workspaces/constants';
36import { Actions } from './actions/lib/actions'; 36import { StoresProps } from './@types/ferdium-components.types';
37import { RealStores } from './stores';
38 37
39type Props = { 38interface IProps extends StoresProps {
40 stores: RealStores; 39 history: HashHistory;
41 actions: Actions; 40}
42 history: any;
43};
44 41
45class FerdiumRoutes extends Component<Props> { 42@inject('stores', 'actions')
43@observer
44class 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
188export default inject('stores', 'actions')(observer(FerdiumRoutes)); 182export default FerdiumRoutes;