From 85d1aac4cd70e79d5ab64684dea09e92b17ed2c2 Mon Sep 17 00:00:00 2001
From: muhamedsalih-tw <104364298+muhamedsalih-tw@users.noreply.github.com>
Date: Tue, 1 Nov 2022 06:42:12 +0530
Subject: Transform ChangeServer components tree to typescript (#725)

---
 src/containers/auth/ChangeServerScreen.tsx | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

(limited to 'src/containers/auth/ChangeServerScreen.tsx')

diff --git a/src/containers/auth/ChangeServerScreen.tsx b/src/containers/auth/ChangeServerScreen.tsx
index 29320a001..db48479cc 100644
--- a/src/containers/auth/ChangeServerScreen.tsx
+++ b/src/containers/auth/ChangeServerScreen.tsx
@@ -2,8 +2,17 @@ import { Component, ReactElement } from 'react';
 import { inject, observer } from 'mobx-react';
 import { StoresProps } from '../../@types/ferdium-components.types';
 import ChangeServer from '../../components/auth/ChangeServer';
+import { Actions } from '../../actions/lib/actions';
+import { RealStores } from '../../stores';
 
-class ChangeServerScreen extends Component<StoresProps> {
+interface IProps {
+  stores?: RealStores;
+  actions?: Actions;
+}
+
+@inject('stores', 'actions')
+@observer
+class ChangeServerScreen extends Component<IProps> {
   constructor(props: StoresProps) {
     super(props);
 
@@ -13,21 +22,18 @@ class ChangeServerScreen extends Component<StoresProps> {
   onSubmit(values: any): void {
     const { server } = values;
 
-    this.props.actions.settings.update({
+    this.props.actions!.settings.update({
       type: 'app',
-      data: {
-        server,
-      },
+      data: { server },
     });
-    this.props.stores.router.push('/auth');
+    this.props.stores!.router.push('/auth');
   }
 
   render(): ReactElement {
-    const { stores } = this.props;
-    const { server } = stores.settings.all.app;
+    const { server } = this.props.stores!.settings.all.app;
 
     return <ChangeServer onSubmit={this.onSubmit} server={server} />;
   }
 }
 
-export default inject('stores', 'actions')(observer(ChangeServerScreen));
+export default ChangeServerScreen;
-- 
cgit v1.2.3-70-g09d2

