diff options
author | Balaji Vijayakumar <kuttibalaji.v6@gmail.com> | 2022-10-31 16:14:30 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-31 10:44:30 +0000 |
commit | 87bc593ac72af503171f759fc6e4b1e9e0813039 (patch) | |
tree | 7128adb5cc48ae36104c4d3e6de219b9de1ac446 /src/routes.tsx | |
parent | Convert web controls & screen to typescript (#722) (diff) | |
download | ferdium-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.tsx | 19 |
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' | |||
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 { StoresProps } from './@types/ferdium-components.types'; | 36 | import { StoresProps } from './@types/ferdium-components.types'; |
37 | import { Actions } from './actions/lib/actions'; | ||
38 | import { RealStores } from './stores'; | ||
37 | 39 | ||
38 | interface IProps extends StoresProps { | 40 | interface 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 { | |||
44 | class FerdiumRoutes extends Component<IProps> { | 49 | class 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 |