aboutsummaryrefslogtreecommitdiffstats
path: root/src/containers/auth/ChangeServerScreen.js
diff options
context:
space:
mode:
authorLibravatar Ricardo Cino <ricardo@cino.io>2022-06-26 23:59:32 +0200
committerLibravatar GitHub <noreply@github.com>2022-06-26 21:59:32 +0000
commit6bff2bb5439d25e0ab2a24a8ca1b28b89ef40ff9 (patch)
tree1676f5eef42b8086d28476c7eaad62c7b1753120 /src/containers/auth/ChangeServerScreen.js
parentReduce tab item layout shift (#376) (diff)
downloadferdium-app-6bff2bb5439d25e0ab2a24a8ca1b28b89ef40ff9.tar.gz
ferdium-app-6bff2bb5439d25e0ab2a24a8ca1b28b89ef40ff9.tar.zst
ferdium-app-6bff2bb5439d25e0ab2a24a8ca1b28b89ef40ff9.zip
chore: turned all auth containers into typescript (#375)
Diffstat (limited to 'src/containers/auth/ChangeServerScreen.js')
-rw-r--r--src/containers/auth/ChangeServerScreen.js45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/containers/auth/ChangeServerScreen.js b/src/containers/auth/ChangeServerScreen.js
deleted file mode 100644
index 60bfde088..000000000
--- a/src/containers/auth/ChangeServerScreen.js
+++ /dev/null
@@ -1,45 +0,0 @@
1import { Component } from 'react';
2import PropTypes from 'prop-types';
3import { inject, observer } from 'mobx-react';
4import { RouterStore } from 'mobx-react-router';
5import ChangeServer from '../../components/auth/ChangeServer';
6import SettingsStore from '../../stores/SettingsStore';
7
8class ChangeServerScreen extends Component {
9 constructor(props) {
10 super(props);
11
12 this.onSubmit = this.onSubmit.bind(this);
13 }
14
15 onSubmit(values) {
16 const { server } = values;
17
18 this.props.actions.settings.update({
19 type: 'app',
20 data: {
21 server,
22 },
23 });
24 this.props.stores.router.push('/auth');
25 }
26
27 render() {
28 const { stores } = this.props;
29 const { server } = stores.settings.all.app;
30
31 return <ChangeServer onSubmit={this.onSubmit} server={server} />;
32 }
33}
34
35ChangeServerScreen.propTypes = {
36 actions: PropTypes.shape({
37 settings: PropTypes.instanceOf(SettingsStore).isRequired,
38 }).isRequired,
39 stores: PropTypes.shape({
40 settings: PropTypes.instanceOf(SettingsStore).isRequired,
41 router: PropTypes.instanceOf(RouterStore).isRequired,
42 }).isRequired,
43};
44
45export default inject('stores', 'actions')(observer(ChangeServerScreen));