diff options
author | 2020-03-25 10:30:08 +0100 | |
---|---|---|
committer | 2020-03-25 10:30:08 +0100 | |
commit | 1cc9c70e4774f4da8b1ad927d6cb7f74c0ce730a (patch) | |
tree | c66660ee310029431c6943b31d6f8c53fcc59616 /src/containers/auth | |
parent | Support new recipe repository hierarchy (#492) (diff) | |
download | ferdium-app-1cc9c70e4774f4da8b1ad927d6cb7f74c0ce730a.tar.gz ferdium-app-1cc9c70e4774f4da8b1ad927d6cb7f74c0ce730a.tar.zst ferdium-app-1cc9c70e4774f4da8b1ad927d6cb7f74c0ce730a.zip |
Improve user onboarding (#493)
Until now, new users have started on the Ferdi dashboard and not on the Welcome screen like Franz does it. This change was made, as users needed to be ablet to change their server before logging in.
This commit will change this onboarding process to bring users to the welcome screen on first login and it adds a new "Change Server" screen during authentication that allows the user to change the server without going to the full settings screen.
This way, the onboarding experience for new users is a lot easier to go though while also improving the experience for experienced users who want to change their server as they only get the option they are looking for and not the whole settings list.
Diffstat (limited to 'src/containers/auth')
-rw-r--r-- | src/containers/auth/ChangeServerScreen.js | 50 | ||||
-rw-r--r-- | src/containers/auth/LoginScreen.js | 1 | ||||
-rw-r--r-- | src/containers/auth/SignupScreen.js | 1 | ||||
-rw-r--r-- | src/containers/auth/WelcomeScreen.js | 1 |
4 files changed, 53 insertions, 0 deletions
diff --git a/src/containers/auth/ChangeServerScreen.js b/src/containers/auth/ChangeServerScreen.js new file mode 100644 index 000000000..5c58087a3 --- /dev/null +++ b/src/containers/auth/ChangeServerScreen.js | |||
@@ -0,0 +1,50 @@ | |||
1 | import React, { 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 | export default @inject('stores', 'actions') @observer 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 ( | ||
32 | <ChangeServer | ||
33 | onSubmit={this.onSubmit} | ||
34 | server={server} | ||
35 | /> | ||
36 | ); | ||
37 | } | ||
38 | } | ||
39 | |||
40 | ChangeServerScreen.wrappedComponent.propTypes = { | ||
41 | actions: PropTypes.shape({ | ||
42 | settings: PropTypes.shape({ | ||
43 | update: PropTypes.func.isRequired, | ||
44 | }).isRequired, | ||
45 | }).isRequired, | ||
46 | stores: PropTypes.shape({ | ||
47 | settings: PropTypes.instanceOf(SettingsStore).isRequired, | ||
48 | router: PropTypes.instanceOf(RouterStore).isRequired, | ||
49 | }).isRequired, | ||
50 | }; | ||
diff --git a/src/containers/auth/LoginScreen.js b/src/containers/auth/LoginScreen.js index e5ee10785..d17820ad6 100644 --- a/src/containers/auth/LoginScreen.js +++ b/src/containers/auth/LoginScreen.js | |||
@@ -21,6 +21,7 @@ export default @inject('stores', 'actions') @observer class LoginScreen extends | |||
21 | isServerLogout={stores.user.logoutReason === stores.user.logoutReasonTypes.SERVER} | 21 | isServerLogout={stores.user.logoutReason === stores.user.logoutReasonTypes.SERVER} |
22 | signupRoute={stores.user.signupRoute} | 22 | signupRoute={stores.user.signupRoute} |
23 | passwordRoute={stores.user.passwordRoute} | 23 | passwordRoute={stores.user.passwordRoute} |
24 | changeServerRoute={stores.user.changeServerRoute} | ||
24 | error={error} | 25 | error={error} |
25 | /> | 26 | /> |
26 | ); | 27 | ); |
diff --git a/src/containers/auth/SignupScreen.js b/src/containers/auth/SignupScreen.js index f93498be2..803fe1cd9 100644 --- a/src/containers/auth/SignupScreen.js +++ b/src/containers/auth/SignupScreen.js | |||
@@ -36,6 +36,7 @@ export default @inject('stores', 'actions') @observer class SignupScreen extends | |||
36 | onSubmit={values => this.onSignup(values)} | 36 | onSubmit={values => this.onSignup(values)} |
37 | isSubmitting={stores.user.signupRequest.isExecuting} | 37 | isSubmitting={stores.user.signupRequest.isExecuting} |
38 | loginRoute={stores.user.loginRoute} | 38 | loginRoute={stores.user.loginRoute} |
39 | changeServerRoute={stores.user.changeServerRoute} | ||
39 | error={error} | 40 | error={error} |
40 | /> | 41 | /> |
41 | ); | 42 | ); |
diff --git a/src/containers/auth/WelcomeScreen.js b/src/containers/auth/WelcomeScreen.js index 75182345a..6f2d0eee6 100644 --- a/src/containers/auth/WelcomeScreen.js +++ b/src/containers/auth/WelcomeScreen.js | |||
@@ -14,6 +14,7 @@ export default @inject('stores', 'actions') @observer class LoginScreen extends | |||
14 | <Welcome | 14 | <Welcome |
15 | loginRoute={user.loginRoute} | 15 | loginRoute={user.loginRoute} |
16 | signupRoute={user.signupRoute} | 16 | signupRoute={user.signupRoute} |
17 | changeServerRoute={user.changeServerRoute} | ||
17 | recipes={recipePreviews.featured} | 18 | recipes={recipePreviews.featured} |
18 | /> | 19 | /> |
19 | ); | 20 | ); |