From 6c7332717bc254c80f755e2542240f7ad3e67883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Thu, 3 Oct 2019 11:40:41 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Switch=20AliasDeploymentButton?= =?UTF-8?q?=20to=20use=20useOvermind?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/overmind/namespaces/deployment/actions.ts | 7 ++++--- .../AliasDeploymentButton.tsx | 15 +++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/app/src/app/overmind/namespaces/deployment/actions.ts b/packages/app/src/app/overmind/namespaces/deployment/actions.ts index b23c884aba5..1580c51cab4 100755 --- a/packages/app/src/app/overmind/namespaces/deployment/actions.ts +++ b/packages/app/src/app/overmind/namespaces/deployment/actions.ts @@ -158,9 +158,10 @@ export const deleteDeployment: AsyncAction = async ({ ); }; -export const aliasDeployment: AsyncAction<{ - id: string; -}> = async ({ state, effects, actions }, { id }) => { +export const aliasDeployment: AsyncAction = async ( + { state, effects, actions }, + id +) => { const zeitConfig = effects.zeit.getConfig(state.editor.currentSandbox); try { diff --git a/packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Zeit/Deploys/Actions/AliasDeploymentButton/AliasDeploymentButton.tsx b/packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Zeit/Deploys/Actions/AliasDeploymentButton/AliasDeploymentButton.tsx index 9937f9daecc..4e415293ebd 100644 --- a/packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Zeit/Deploys/Actions/AliasDeploymentButton/AliasDeploymentButton.tsx +++ b/packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Zeit/Deploys/Actions/AliasDeploymentButton/AliasDeploymentButton.tsx @@ -1,13 +1,14 @@ -import React from 'react'; -import { useOvermind } from 'app/overmind'; import { ZeitDeployment } from '@codesandbox/common/lib/types'; +import React, { FunctionComponent } from 'react'; + +import { useOvermind } from 'app/overmind'; + import { Action } from '../../../../elements'; type Props = { deploy: ZeitDeployment; }; - -export const AliasDeploymentButton: React.FC = ({ +export const AliasDeploymentButton: FunctionComponent = ({ deploy: { alias: aliases, uid: id }, }) => { const { @@ -15,11 +16,9 @@ export const AliasDeploymentButton: React.FC = ({ deployment: { aliasDeployment }, }, } = useOvermind(); + return ( - 0} - onClick={() => aliasDeployment({ id })} - > + 0} onClick={() => aliasDeployment(id)}> {aliases.length > 0 ? 'Aliased' : 'Alias'} );