Skip to content

Commit 8701fda

Browse files
committed
🔨 Switch AliasDeploymentButton to use useOvermind
1 parent b6f0d96 commit 8701fda

File tree

2 files changed

+11
-11
lines changed
  • packages/app/src/app

2 files changed

+11
-11
lines changed

‎packages/app/src/app/overmind/namespaces/deployment/actions.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,10 @@ export const deleteDeployment: AsyncAction = async ({
163163
);
164164
};
165165

166-
export const aliasDeployment: AsyncAction<{
167-
id: string;
168-
}> = async ({ state, effects, actions }, { id }) => {
166+
export const aliasDeployment: AsyncAction<string> = async (
167+
{ state, effects, actions },
168+
id
169+
) => {
169170
const zeitConfig = effects.zeit.getConfig(state.editor.currentSandbox);
170171

171172
try {

‎packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Zeit/Deploys/Actions/AliasDeploymentButton/AliasDeploymentButton.tsx‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
import React from 'react';
2-
import { useOvermind } from 'app/overmind';
31
import { ZeitDeployment } from '@codesandbox/common/lib/types';
2+
import React, { FunctionComponent } from 'react';
3+
4+
import { useOvermind } from 'app/overmind';
5+
46
import { Action } from '../../../../elements';
57

68
type Props = {
79
deploy: ZeitDeployment;
810
};
9-
10-
export const AliasDeploymentButton: React.FC<Props> = ({
11+
export const AliasDeploymentButton: FunctionComponent<Props> = ({
1112
deploy: { alias: aliases, uid: id },
1213
}) => {
1314
const {
1415
actions: {
1516
deployment: { aliasDeployment },
1617
},
1718
} = useOvermind();
19+
1820
return (
19-
<Action
20-
disabled={aliases.length > 0}
21-
onClick={() => aliasDeployment({ id })}
22-
>
21+
<Action disabled={aliases.length > 0} onClick={() => aliasDeployment(id)}>
2322
{aliases.length > 0 ? 'Aliased' : 'Alias'}
2423
</Action>
2524
);

0 commit comments

Comments
 (0)