diff options
author | 2022-06-26 23:59:32 +0200 | |
---|---|---|
committer | 2022-06-26 21:59:32 +0000 | |
commit | 6bff2bb5439d25e0ab2a24a8ca1b28b89ef40ff9 (patch) | |
tree | 1676f5eef42b8086d28476c7eaad62c7b1753120 /src/containers/auth/ChangeServerScreen.js | |
parent | Reduce tab item layout shift (#376) (diff) | |
download | ferdium-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.js | 45 |
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 @@ | |||
1 | import { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { inject, observer } from 'mobx-react'; | ||
4 | import { RouterStore } from 'mobx-react-router'; | ||
5 | import ChangeServer from '../../components/auth/ChangeServer'; | ||
6 | import SettingsStore from '../../stores/SettingsStore'; | ||
7 | |||
8 | class 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 | |||
35 | ChangeServerScreen.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 | |||
45 | export default inject('stores', 'actions')(observer(ChangeServerScreen)); | ||