From 2d71e61e46394d75d9f52ba1f4c273ed6d3c9cfd Mon Sep 17 00:00:00 2001 From: Ricardo Cino Date: Fri, 24 Jun 2022 21:25:05 +0200 Subject: chore: convert the last few stores to typescript --- src/containers/auth/ImportScreen.tsx | 12 ++++++------ src/containers/auth/LockedScreen.tsx | 22 +++++++++++----------- src/containers/auth/PasswordScreen.tsx | 10 +++++----- 3 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src/containers') diff --git a/src/containers/auth/ImportScreen.tsx b/src/containers/auth/ImportScreen.tsx index 756a2e59c..8d318cb2d 100644 --- a/src/containers/auth/ImportScreen.tsx +++ b/src/containers/auth/ImportScreen.tsx @@ -1,17 +1,17 @@ import { Component } from 'react'; import { inject, observer } from 'mobx-react'; import { RouterStore } from 'mobx-react-router'; +import { UserStore } from 'src/stores.types'; import Import from '../../components/auth/Import'; -import UserStore from '../../stores/UserStore'; interface IProps { actions: { - user: UserStore, - }, + user: UserStore; + }; stores: { - user: UserStore, - router: RouterStore, - } + user: UserStore; + router: RouterStore; + }; } class ImportScreen extends Component { diff --git a/src/containers/auth/LockedScreen.tsx b/src/containers/auth/LockedScreen.tsx index e6bb5e8e4..500bff0d6 100644 --- a/src/containers/auth/LockedScreen.tsx +++ b/src/containers/auth/LockedScreen.tsx @@ -1,20 +1,20 @@ -import { Component } from 'react'; +import { Component, ReactElement } from 'react'; import { inject, observer } from 'mobx-react'; +import { SettingsStore } from 'src/stores.types'; import Locked from '../../components/auth/Locked'; -import SettingsStore from '../../stores/SettingsStore'; import { hash } from '../../helpers/password-helpers'; import UserStore from '../../stores/UserStore'; interface IProps { actions: { - settings: SettingsStore, - }, + settings: SettingsStore; + }; stores: { - settings: SettingsStore, - user: UserStore, - } -}; + settings: SettingsStore; + user: UserStore; + }; +} class LockedScreen extends Component { state = { @@ -28,7 +28,7 @@ class LockedScreen extends Component { this.unlock = this.unlock.bind(this); } - onSubmit(values) { + onSubmit(values): void { const { password } = values; let correctPassword = this.props.stores.settings.all.app.lockedPassword; @@ -52,7 +52,7 @@ class LockedScreen extends Component { } } - unlock() { + unlock(): void { this.props.actions.settings.update({ type: 'app', data: { @@ -61,7 +61,7 @@ class LockedScreen extends Component { }); } - render() { + render(): ReactElement { const { stores } = this.props; const { useTouchIdToUnlock } = this.props.stores.settings.all.app; diff --git a/src/containers/auth/PasswordScreen.tsx b/src/containers/auth/PasswordScreen.tsx index 864a11fa7..d88549712 100644 --- a/src/containers/auth/PasswordScreen.tsx +++ b/src/containers/auth/PasswordScreen.tsx @@ -1,15 +1,15 @@ import { Component } from 'react'; import { inject, observer } from 'mobx-react'; +import { UserStore } from 'src/stores.types'; import Password from '../../components/auth/Password'; -import UserStore from '../../stores/UserStore'; interface IProps { actions: { - user: UserStore, - }, + user: UserStore; + }; stores: { - user: UserStore, - } + user: UserStore; + }; }; class PasswordScreen extends Component { -- cgit v1.2.3-54-g00ecf