From 0bf13689d53bd493fb4d0a4213c1801013b5aa8a Mon Sep 17 00:00:00 2001
From: Ricardo Cino <ricardo@cino.io>
Date: Mon, 27 Jun 2022 18:21:31 +0200
Subject: chore: transform containers/settings from js to tsx (#384)

---
 src/containers/settings/InviteScreen.tsx | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 src/containers/settings/InviteScreen.tsx

(limited to 'src/containers/settings/InviteScreen.tsx')

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 @@
+import { Component, ReactNode } from 'react';
+import { inject, observer } from 'mobx-react';
+
+import { StoresProps } from 'src/@types/ferdium-components.types';
+import Invite from '../../components/auth/Invite';
+import ErrorBoundary from '../../components/util/ErrorBoundary';
+
+class InviteScreen extends Component<StoresProps> {
+  componentWillUnmount(): void {
+    this.props.stores.user.inviteRequest.reset();
+  }
+
+  render(): ReactNode {
+    const { actions } = this.props;
+    const { user } = this.props.stores;
+
+    return (
+      <ErrorBoundary>
+        <Invite
+          onSubmit={actions.user.invite}
+          isLoadingInvite={user.inviteRequest.isExecuting}
+          isInviteSuccessful={
+            user.inviteRequest.wasExecuted && !user.inviteRequest.isError
+          }
+          embed
+        />
+      </ErrorBoundary>
+    );
+  }
+}
+
+export default inject('stores', 'actions')(observer(InviteScreen));
-- 
cgit v1.2.3-70-g09d2

