diff options
author | Ricardo Cino <ricardo@cino.io> | 2022-06-27 18:21:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-27 17:21:31 +0100 |
commit | 0bf13689d53bd493fb4d0a4213c1801013b5aa8a (patch) | |
tree | 2b5ae44e4f1aa73b49c011954ff1cb47e3959bad /src/containers/settings/InviteScreen.tsx | |
parent | chore: recommend specific vscode extensions to setup development [skip ci] (#... (diff) | |
download | ferdium-app-0bf13689d53bd493fb4d0a4213c1801013b5aa8a.tar.gz ferdium-app-0bf13689d53bd493fb4d0a4213c1801013b5aa8a.tar.zst ferdium-app-0bf13689d53bd493fb4d0a4213c1801013b5aa8a.zip |
chore: transform containers/settings from js to tsx (#384)
Diffstat (limited to 'src/containers/settings/InviteScreen.tsx')
-rw-r--r-- | src/containers/settings/InviteScreen.tsx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/containers/settings/InviteScreen.tsx b/src/containers/settings/InviteScreen.tsx new file mode 100644 index 000000000..ff192783c --- /dev/null +++ b/src/containers/settings/InviteScreen.tsx | |||
@@ -0,0 +1,32 @@ | |||
1 | import { Component, ReactNode } from 'react'; | ||
2 | import { inject, observer } from 'mobx-react'; | ||
3 | |||
4 | import { StoresProps } from 'src/@types/ferdium-components.types'; | ||
5 | import Invite from '../../components/auth/Invite'; | ||
6 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | ||
7 | |||
8 | class InviteScreen extends Component<StoresProps> { | ||
9 | componentWillUnmount(): void { | ||
10 | this.props.stores.user.inviteRequest.reset(); | ||
11 | } | ||
12 | |||
13 | render(): ReactNode { | ||
14 | const { actions } = this.props; | ||
15 | const { user } = this.props.stores; | ||
16 | |||
17 | return ( | ||
18 | <ErrorBoundary> | ||
19 | <Invite | ||
20 | onSubmit={actions.user.invite} | ||
21 | isLoadingInvite={user.inviteRequest.isExecuting} | ||
22 | isInviteSuccessful={ | ||
23 | user.inviteRequest.wasExecuted && !user.inviteRequest.isError | ||
24 | } | ||
25 | embed | ||
26 | /> | ||
27 | </ErrorBoundary> | ||
28 | ); | ||
29 | } | ||
30 | } | ||
31 | |||
32 | export default inject('stores', 'actions')(observer(InviteScreen)); | ||