From 6bff2bb5439d25e0ab2a24a8ca1b28b89ef40ff9 Mon Sep 17 00:00:00 2001
From: Ricardo Cino <ricardo@cino.io>
Date: Sun, 26 Jun 2022 23:59:32 +0200
Subject: chore: turned all auth containers into typescript (#375)

---
 src/containers/auth/ChangeServerScreen.tsx | 33 ++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 src/containers/auth/ChangeServerScreen.tsx

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

diff --git a/src/containers/auth/ChangeServerScreen.tsx b/src/containers/auth/ChangeServerScreen.tsx
new file mode 100644
index 000000000..6af87e4a1
--- /dev/null
+++ b/src/containers/auth/ChangeServerScreen.tsx
@@ -0,0 +1,33 @@
+import { Component, ReactElement } from 'react';
+import { inject, observer } from 'mobx-react';
+import { DefaultProps } from 'src/@types/ferdium-components.types';
+import ChangeServer from '../../components/auth/ChangeServer';
+
+class ChangeServerScreen extends Component<DefaultProps> {
+  constructor(props: DefaultProps) {
+    super(props);
+
+    this.onSubmit = this.onSubmit.bind(this);
+  }
+
+  onSubmit(values: any): void {
+    const { server } = values;
+
+    this.props.actions.settings.update({
+      type: 'app',
+      data: {
+        server,
+      },
+    });
+    this.props.stores.router.push('/auth');
+  }
+
+  render(): ReactElement {
+    const { stores } = this.props;
+    const { server } = stores.settings.all.app;
+
+    return <ChangeServer onSubmit={this.onSubmit} server={server} />;
+  }
+}
+
+export default inject('stores', 'actions')(observer(ChangeServerScreen));
-- 
cgit v1.2.3-70-g09d2

