From 7174e5114b2f7866599cca9e0e01220d1caeeca1 Mon Sep 17 00:00:00 2001 From: Ravi Soni Date: Sun, 13 Oct 2019 17:43:24 +0530 Subject: [PATCH 1/2] Refactor /common/Modals/DeleteProfileSandboxModal to use overmind --- .../Modals/DeleteProfileSandboxModal/index.js | 16 -------------- .../DeleteProfileSandboxModal/index.tsx | 21 +++++++++++++++++++ 2 files changed, 21 insertions(+), 16 deletions(-) delete mode 100644 packages/app/src/app/pages/common/Modals/DeleteProfileSandboxModal/index.js create mode 100644 packages/app/src/app/pages/common/Modals/DeleteProfileSandboxModal/index.tsx diff --git a/packages/app/src/app/pages/common/Modals/DeleteProfileSandboxModal/index.js b/packages/app/src/app/pages/common/Modals/DeleteProfileSandboxModal/index.js deleted file mode 100644 index 032d37da3a9..00000000000 --- a/packages/app/src/app/pages/common/Modals/DeleteProfileSandboxModal/index.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import { Alert } from 'app/components/Alert'; -import { inject, hooksObserver } from 'app/componentConnectors'; - -function DeleteProfileSandboxModal({ signals }) { - return ( - Are you sure you want to delete this sandbox?} - onCancel={() => signals.modalClosed()} - onConfirm={() => signals.profile.sandboxDeleted()} - /> - ); -} - -export default inject('signals')(hooksObserver(DeleteProfileSandboxModal)); diff --git a/packages/app/src/app/pages/common/Modals/DeleteProfileSandboxModal/index.tsx b/packages/app/src/app/pages/common/Modals/DeleteProfileSandboxModal/index.tsx new file mode 100644 index 00000000000..3e46941955f --- /dev/null +++ b/packages/app/src/app/pages/common/Modals/DeleteProfileSandboxModal/index.tsx @@ -0,0 +1,21 @@ +import React, { FunctionComponent } from 'react'; +import { useOvermind } from 'app/overmind'; +import { Alert } from 'app/components/Alert'; + +export const DeleteProfileSandboxModal: FunctionComponent = () => { + const { + actions: { + modalClosed, + profile: { sandboxDeleted }, + }, + } = useOvermind(); + + return ( + modalClosed()} + onConfirm={() => sandboxDeleted()} + /> + ); +}; From 46853f137948887cc8ed00aedb077299b4d73d44 Mon Sep 17 00:00:00 2001 From: Ravi Soni Date: Sun, 13 Oct 2019 22:04:32 +0530 Subject: [PATCH 2/2] Fix default export --- .../pages/common/Modals/DeleteProfileSandboxModal/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/app/src/app/pages/common/Modals/DeleteProfileSandboxModal/index.tsx b/packages/app/src/app/pages/common/Modals/DeleteProfileSandboxModal/index.tsx index 3e46941955f..0ef54af7921 100644 --- a/packages/app/src/app/pages/common/Modals/DeleteProfileSandboxModal/index.tsx +++ b/packages/app/src/app/pages/common/Modals/DeleteProfileSandboxModal/index.tsx @@ -2,7 +2,7 @@ import React, { FunctionComponent } from 'react'; import { useOvermind } from 'app/overmind'; import { Alert } from 'app/components/Alert'; -export const DeleteProfileSandboxModal: FunctionComponent = () => { +const DeleteProfileSandboxModal: FunctionComponent = () => { const { actions: { modalClosed, @@ -19,3 +19,6 @@ export const DeleteProfileSandboxModal: FunctionComponent = () => { /> ); }; + +// eslint-disable-next-line import/no-default-export +export default DeleteProfileSandboxModal;