diff options
author | 2022-10-31 05:20:17 +0530 | |
---|---|---|
committer | 2022-10-30 23:50:17 +0000 | |
commit | 011e73f24f8ae15091d41781c93c313d0167d887 (patch) | |
tree | 3e012f97a9c3ecf98e348690f82dae0d58ec0155 /src/containers/auth | |
parent | 6.2.1-nightly.33 [skip ci] (diff) | |
download | ferdium-app-011e73f24f8ae15091d41781c93c313d0167d887.tar.gz ferdium-app-011e73f24f8ae15091d41781c93c313d0167d887.tar.zst ferdium-app-011e73f24f8ae15091d41781c93c313d0167d887.zip |
Convert LoginScreen component tree to typescript (#721)
Diffstat (limited to 'src/containers/auth')
-rw-r--r-- | src/containers/auth/LoginScreen.tsx | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/containers/auth/LoginScreen.tsx b/src/containers/auth/LoginScreen.tsx index 64e06e59d..c4782d287 100644 --- a/src/containers/auth/LoginScreen.tsx +++ b/src/containers/auth/LoginScreen.tsx | |||
@@ -6,27 +6,29 @@ import { | |||
6 | } from '../../@types/ferdium-components.types'; | 6 | } from '../../@types/ferdium-components.types'; |
7 | import Login from '../../components/auth/Login'; | 7 | import Login from '../../components/auth/Login'; |
8 | 8 | ||
9 | interface LoginScreenProps extends StoresProps { | 9 | interface IProps extends Partial<StoresProps> { |
10 | error: GlobalError; | 10 | error: GlobalError; |
11 | } | 11 | } |
12 | 12 | ||
13 | class LoginScreen extends Component<LoginScreenProps> { | 13 | @inject('stores', 'actions') |
14 | @observer | ||
15 | class LoginScreen extends Component<IProps> { | ||
14 | render(): ReactElement { | 16 | render(): ReactElement { |
15 | const { actions, stores, error } = this.props; | 17 | const { actions, stores, error } = this.props; |
16 | return ( | 18 | return ( |
17 | <Login | 19 | <Login |
18 | onSubmit={actions.user.login} | 20 | onSubmit={actions!.user.login} |
19 | isSubmitting={stores.user.loginRequest.isExecuting} | 21 | isSubmitting={stores!.user.loginRequest.isExecuting} |
20 | isTokenExpired={stores.user.isTokenExpired} | 22 | isTokenExpired={stores!.user.isTokenExpired} |
21 | isServerLogout={ | 23 | isServerLogout={ |
22 | stores.user.logoutReason === stores.user.logoutReasonTypes.SERVER | 24 | stores!.user.logoutReason === stores!.user.logoutReasonTypes.SERVER |
23 | } | 25 | } |
24 | signupRoute={stores.user.signupRoute} | 26 | signupRoute={stores!.user.signupRoute} |
25 | passwordRoute={stores.user.passwordRoute} | 27 | passwordRoute={stores!.user.passwordRoute} |
26 | error={error} | 28 | error={error} |
27 | /> | 29 | /> |
28 | ); | 30 | ); |
29 | } | 31 | } |
30 | } | 32 | } |
31 | 33 | ||
32 | export default inject('stores', 'actions')(observer(LoginScreen)); | 34 | export default LoginScreen; |