diff options
author | 2018-02-12 14:16:33 +0100 | |
---|---|---|
committer | 2018-02-12 14:16:33 +0100 | |
commit | 7a1872e64262a76f17ac231a47fd8f57cd5a13ac (patch) | |
tree | 29ed8aa4dfcb9b179f4fe47c30fb33cf78c2e2ce /src/containers/settings/InviteScreen.js | |
parent | Merge pull request #668 from meetfranz/fix/import-screen-toggles (diff) | |
parent | feat(App) Feature Invite Friends in Settings (diff) | |
download | ferdium-app-7a1872e64262a76f17ac231a47fd8f57cd5a13ac.tar.gz ferdium-app-7a1872e64262a76f17ac231a47fd8f57cd5a13ac.tar.zst ferdium-app-7a1872e64262a76f17ac231a47fd8f57cd5a13ac.zip |
Merge pull request #654 from meetfranz/feature/invite-button
Invite Button in Settings
Diffstat (limited to 'src/containers/settings/InviteScreen.js')
-rw-r--r-- | src/containers/settings/InviteScreen.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/containers/settings/InviteScreen.js b/src/containers/settings/InviteScreen.js new file mode 100644 index 000000000..5f341b1b3 --- /dev/null +++ b/src/containers/settings/InviteScreen.js | |||
@@ -0,0 +1,44 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { inject, observer } from 'mobx-react'; | ||
4 | |||
5 | import Invite from '../../components/auth/Invite'; | ||
6 | import { gaPage } from '../../lib/analytics'; | ||
7 | |||
8 | @inject('stores', 'actions') @observer | ||
9 | export default class InviteScreen extends Component { | ||
10 | componentDidMount() { | ||
11 | gaPage('Settings/Invite'); | ||
12 | } | ||
13 | |||
14 | componentWillUnmount() { | ||
15 | this.props.stores.user.inviteRequest.reset(); | ||
16 | } | ||
17 | |||
18 | render() { | ||
19 | const { actions } = this.props; | ||
20 | const { user } = this.props.stores; | ||
21 | |||
22 | return ( | ||
23 | <Invite | ||
24 | onSubmit={actions.user.invite} | ||
25 | isLoadingInvite={user.inviteRequest.isExecuting} | ||
26 | isInviteSuccessful={user.inviteRequest.wasExecuted && !user.inviteRequest.isError} | ||
27 | embed | ||
28 | /> | ||
29 | ); | ||
30 | } | ||
31 | } | ||
32 | |||
33 | InviteScreen.wrappedComponent.propTypes = { | ||
34 | actions: PropTypes.shape({ | ||
35 | user: PropTypes.shape({ | ||
36 | invite: PropTypes.func.isRequired, | ||
37 | }).isRequired, | ||
38 | }).isRequired, | ||
39 | stores: PropTypes.shape({ | ||
40 | user: PropTypes.shape({ | ||
41 | inviteRequest: PropTypes.object, | ||
42 | }).isRequired, | ||
43 | }).isRequired, | ||
44 | }; | ||