From f28189bd35dd94e507c62f909953e2ab44d4df89 Mon Sep 17 00:00:00 2001 From: Saagar Takhi Date: Sat, 12 Oct 2019 11:54:40 +0530 Subject: [PATCH] Refactors Nelify/SiteInfo.tsx to replace Cerebral with Overmind & fixes NetlifySite id type --- .../Deployment/Netlify/SiteInfo/SiteInfo.tsx | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Netlify/SiteInfo/SiteInfo.tsx b/packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Netlify/SiteInfo/SiteInfo.tsx index 11fd66e6561..7072feedbd8 100644 --- a/packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Netlify/SiteInfo/SiteInfo.tsx +++ b/packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Netlify/SiteInfo/SiteInfo.tsx @@ -1,5 +1,5 @@ -import React from 'react'; -import { inject, hooksObserver } from 'app/componentConnectors'; +import React, { FunctionComponent } from 'react'; +import { useOvermind } from 'app/overmind'; import getNetlifyConfig from 'app/utils/getNetlifyConfig'; @@ -29,43 +29,43 @@ const getFunctionDir = sandbox => { } }; -export const SiteInfo = inject('store')( - hooksObserver( - ({ - store: { - deployment: { building, netlifyLogs, netlifySite }, - editor: { currentSandbox }, +export const SiteInfo: FunctionComponent = () => { + const { + state: { + deployment: { + building, + netlifyLogs, + netlifySite: { id, name }, }, - }) => { - const functionDirectory = getFunctionDir(currentSandbox); - const functions = functionDirectory - ? currentSandbox.modules.filter( - ({ directoryShortid }) => - directoryShortid === functionDirectory.shortid - ) - : []; + editor: { currentSandbox }, + }, + } = useOvermind(); + const functionDirectory = getFunctionDir(currentSandbox); + const functions = functionDirectory + ? currentSandbox.modules.filter( + ({ directoryShortid }) => directoryShortid === functionDirectory.shortid + ) + : []; - return ( - - Sandbox Site + return ( + + Sandbox Site - - - - {netlifySite.name} + + + + {name} - {!building &&
Building
} + {!building &&
Building
} - {functions.length ? : null} + {functions.length ? : null} - + - {netlifyLogs ? : null} -
-
-
-
- ); - } - ) -); + {netlifyLogs ? : null} + + + +
+ ); +};