From 8055b6865303ea827b546f9096ac9f81e8c78e7a Mon Sep 17 00:00:00 2001 From: stevetangue Date: Sat, 12 Oct 2019 21:39:39 +1000 Subject: [PATCH] refactor DeleteProfileSandboxModal to use useOvermind --- .../Modals/DeleteProfileSandboxModal/index.js | 16 -------------- .../DeleteProfileSandboxModal/index.tsx | 22 +++++++++++++++++++ 2 files changed, 22 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..7f8d0ce02ea --- /dev/null +++ b/packages/app/src/app/pages/common/Modals/DeleteProfileSandboxModal/index.tsx @@ -0,0 +1,22 @@ +import React, { FunctionComponent } from 'react'; +import { Alert } from 'app/components/Alert'; +import { useOvermind } from 'app/overmind'; + +const DeleteProfileSandboxModal: FunctionComponent = () => { + const { + actions: { + modalClosed, + profile: { sandboxDeleted }, + }, + } = useOvermind(); + return ( + modalClosed()} + onConfirm={() => sandboxDeleted()} + /> + ); +} + +export default DeleteProfileSandboxModal;