From f79727a8632490f11c1423773fdd6adfb6337a7b Mon Sep 17 00:00:00 2001 From: muhamedsalih-tw <104364298+muhamedsalih-tw@users.noreply.github.com> Date: Tue, 25 Oct 2022 12:51:28 +0530 Subject: Transform 'AuthLayoutContainer' component hierarchy to tsx (#699) Co-authored-by: Muhamed <> Co-authored-by: Vijay A --- src/routes.tsx | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'src/routes.tsx') 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 { Routes, unstable_HistoryRouter as HistoryRouter, } from 'react-router-dom'; - +import { HashHistory } from 'history'; import AppLayoutContainer from './containers/layout/AppLayoutContainer'; import SettingsWindow from './containers/settings/SettingsWindow'; import ReleaseNotesWindow from './containers/settings/ReleaseNotesWindow'; @@ -33,25 +33,19 @@ import AuthLayoutContainer from './containers/auth/AuthLayoutContainer'; import WorkspacesScreen from './features/workspaces/containers/WorkspacesScreen'; import EditWorkspaceScreen from './features/workspaces/containers/EditWorkspaceScreen'; import { WORKSPACES_ROUTES } from './features/workspaces/constants'; -import { Actions } from './actions/lib/actions'; -import { RealStores } from './stores'; +import { StoresProps } from './@types/ferdium-components.types'; -type Props = { - stores: RealStores; - actions: Actions; - history: any; -}; +interface IProps extends StoresProps { + history: HashHistory; +} -class FerdiumRoutes extends Component { +@inject('stores', 'actions') +@observer +class FerdiumRoutes extends Component { render(): ReactElement { - const { history } = this.props; - const routeProps = { - stores: this.props.stores, - actions: this.props.actions, - }; - const errorProps = { - error: this.props.stores.globalError.error || {}, - }; + const { history, stores, actions } = this.props; + const routeProps: StoresProps = { stores, actions }; + const errorProps = { error: this.props.stores.globalError.error || {} }; return ( @@ -185,4 +179,4 @@ class FerdiumRoutes extends Component { } } -export default inject('stores', 'actions')(observer(FerdiumRoutes)); +export default FerdiumRoutes; -- cgit v1.2.3-54-g00ecf