diff options
author | Ricardo Cino <ricardo@cino.io> | 2022-07-07 09:31:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-07 09:31:50 +0200 |
commit | 71c52373f81cace664047edd19d9d289f45a4dff (patch) | |
tree | 69b3f1d45a8b3f1ceab9497ea3c96e9dc18e3166 /src/containers/auth | |
parent | 6.0.0-nightly.91 [skip ci] (diff) | |
download | ferdium-app-71c52373f81cace664047edd19d9d289f45a4dff.tar.gz ferdium-app-71c52373f81cace664047edd19d9d289f45a4dff.tar.zst ferdium-app-71c52373f81cace664047edd19d9d289f45a4dff.zip |
chore: Mobx & React-Router upgrade (#406)
Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
Diffstat (limited to 'src/containers/auth')
-rw-r--r-- | src/containers/auth/AuthLayoutContainer.tsx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/containers/auth/AuthLayoutContainer.tsx b/src/containers/auth/AuthLayoutContainer.tsx index 1f2753a66..8d31cfb48 100644 --- a/src/containers/auth/AuthLayoutContainer.tsx +++ b/src/containers/auth/AuthLayoutContainer.tsx | |||
@@ -1,20 +1,17 @@ | |||
1 | import { Component, ReactElement, ReactNode } from 'react'; | 1 | import { Component, ReactElement } from 'react'; |
2 | import { inject, observer } from 'mobx-react'; | 2 | import { inject, observer } from 'mobx-react'; |
3 | import { ThemeProvider } from 'react-jss'; | 3 | import { ThemeProvider } from 'react-jss'; |
4 | import { Outlet } from 'react-router-dom'; | ||
4 | 5 | ||
5 | import { Location } from 'mobx-react-router'; | ||
6 | import { StoresProps } from '../../@types/ferdium-components.types'; | 6 | import { StoresProps } from '../../@types/ferdium-components.types'; |
7 | import AuthLayout from '../../components/auth/AuthLayout'; | 7 | import AuthLayout from '../../components/auth/AuthLayout'; |
8 | import AppLoader from '../../components/ui/AppLoader'; | 8 | import AppLoader from '../../components/ui/AppLoader'; |
9 | 9 | ||
10 | interface AuthLayoutContainerProps extends StoresProps { | 10 | interface AuthLayoutContainerProps extends StoresProps {} |
11 | location: Location; | ||
12 | children: ReactNode; | ||
13 | } | ||
14 | 11 | ||
15 | class AuthLayoutContainer extends Component<AuthLayoutContainerProps> { | 12 | class AuthLayoutContainer extends Component<AuthLayoutContainerProps> { |
16 | render(): ReactElement { | 13 | render(): ReactElement { |
17 | const { stores, actions, children, location } = this.props; | 14 | const { stores, actions } = this.props; |
18 | const { app, features, globalError, user } = stores; | 15 | const { app, features, globalError, user } = stores; |
19 | 16 | ||
20 | const isLoadingBaseFeatures = | 17 | const isLoadingBaseFeatures = |
@@ -42,7 +39,7 @@ class AuthLayoutContainer extends Component<AuthLayoutContainerProps> { | |||
42 | <ThemeProvider theme={stores.ui.theme}> | 39 | <ThemeProvider theme={stores.ui.theme}> |
43 | <AuthLayout | 40 | <AuthLayout |
44 | error={globalError.response} | 41 | error={globalError.response} |
45 | pathname={location.pathname} | 42 | pathname={stores.router.location.pathname} |
46 | isOnline={app.isOnline} | 43 | isOnline={app.isOnline} |
47 | isAPIHealthy={!app.healthCheckRequest.isError} | 44 | isAPIHealthy={!app.healthCheckRequest.isError} |
48 | retryHealthCheck={actions.app.healthCheck} | 45 | retryHealthCheck={actions.app.healthCheck} |
@@ -53,7 +50,7 @@ class AuthLayoutContainer extends Component<AuthLayoutContainerProps> { | |||
53 | app.updateStatus === app.updateStatusTypes.DOWNLOADED | 50 | app.updateStatus === app.updateStatusTypes.DOWNLOADED |
54 | } | 51 | } |
55 | > | 52 | > |
56 | {children} | 53 | <Outlet /> |
57 | </AuthLayout> | 54 | </AuthLayout> |
58 | </ThemeProvider> | 55 | </ThemeProvider> |
59 | ); | 56 | ); |