aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes.tsx
diff options
context:
space:
mode:
authorLibravatar Balaji Vijayakumar <kuttibalaji.v6@gmail.com>2022-10-31 16:14:30 +0530
committerLibravatar GitHub <noreply@github.com>2022-10-31 10:44:30 +0000
commit87bc593ac72af503171f759fc6e4b1e9e0813039 (patch)
tree7128adb5cc48ae36104c4d3e6de219b9de1ac446 /src/routes.tsx
parentConvert web controls & screen to typescript (#722) (diff)
downloadferdium-app-87bc593ac72af503171f759fc6e4b1e9e0813039.tar.gz
ferdium-app-87bc593ac72af503171f759fc6e4b1e9e0813039.tar.zst
ferdium-app-87bc593ac72af503171f759fc6e4b1e9e0813039.zip
refactor: convert global app to typescript (#723)
Diffstat (limited to 'src/routes.tsx')
-rw-r--r--src/routes.tsx19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/routes.tsx b/src/routes.tsx
index e757de72b..27ed6259c 100644
--- a/src/routes.tsx
+++ b/src/routes.tsx
@@ -34,9 +34,14 @@ import 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 { StoresProps } from './@types/ferdium-components.types'; 36import { StoresProps } from './@types/ferdium-components.types';
37import { Actions } from './actions/lib/actions';
38import { RealStores } from './stores';
37 39
38interface IProps extends StoresProps { 40interface IProps {
39 history: HashHistory; 41 history: HashHistory;
42
43 actions?: Actions;
44 stores?: RealStores;
40} 45}
41 46
42@inject('stores', 'actions') 47@inject('stores', 'actions')
@@ -44,8 +49,8 @@ interface IProps extends StoresProps {
44class FerdiumRoutes extends Component<IProps> { 49class FerdiumRoutes extends Component<IProps> {
45 render(): ReactElement { 50 render(): ReactElement {
46 const { history, stores, actions } = this.props; 51 const { history, stores, actions } = this.props;
47 const routeProps: StoresProps = { stores, actions }; 52 const routeProps: StoresProps = { stores: stores!, actions: actions! };
48 const errorProps = { error: this.props.stores.globalError.error || {} }; 53 const errorProps = { error: routeProps.stores.globalError.error || {} };
49 54
50 return ( 55 return (
51 <HistoryRouter history={history}> 56 <HistoryRouter history={history}>
@@ -129,6 +134,7 @@ class FerdiumRoutes extends Component<IProps> {
129 /> 134 />
130 <Route 135 <Route
131 path="/settings/services" 136 path="/settings/services"
137 /* @ts-ignore */
132 element={<ServicesScreen {...this.props} />} 138 element={<ServicesScreen {...this.props} />}
133 /> 139 />
134 <Route 140 <Route
@@ -137,30 +143,37 @@ class FerdiumRoutes extends Component<IProps> {
137 /> 143 />
138 <Route 144 <Route
139 path={WORKSPACES_ROUTES.ROOT} 145 path={WORKSPACES_ROUTES.ROOT}
146 /* @ts-ignore */
140 element={<WorkspacesScreen {...this.props} />} 147 element={<WorkspacesScreen {...this.props} />}
141 /> 148 />
142 <Route 149 <Route
143 path={WORKSPACES_ROUTES.EDIT} 150 path={WORKSPACES_ROUTES.EDIT}
151 /* @ts-ignore */
144 element={<EditWorkspaceScreen {...this.props} />} 152 element={<EditWorkspaceScreen {...this.props} />}
145 /> 153 />
146 <Route 154 <Route
147 path="/settings/user" 155 path="/settings/user"
156 /* @ts-ignore */
148 element={<AccountScreen {...this.props} />} 157 element={<AccountScreen {...this.props} />}
149 /> 158 />
150 <Route 159 <Route
151 path="/settings/user/edit" 160 path="/settings/user/edit"
161 /* @ts-ignore */
152 element={<EditUserScreen {...this.props} />} 162 element={<EditUserScreen {...this.props} />}
153 /> 163 />
154 <Route 164 <Route
155 path="/settings/team" 165 path="/settings/team"
166 /* @ts-ignore */
156 element={<TeamScreen {...this.props} />} 167 element={<TeamScreen {...this.props} />}
157 /> 168 />
158 <Route 169 <Route
159 path="/settings/app" 170 path="/settings/app"
171 /* @ts-ignore */
160 element={<EditSettingsScreen {...this.props} />} 172 element={<EditSettingsScreen {...this.props} />}
161 /> 173 />
162 <Route 174 <Route
163 path="/settings/invite" 175 path="/settings/invite"
176 /* @ts-ignore */
164 element={<InviteSettingsScreen {...this.props} />} 177 element={<InviteSettingsScreen {...this.props} />}
165 /> 178 />
166 <Route 179 <Route