Skip to content

Commit 78bdc0d

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
🔨 Switch ActionsZeit to use useOvermind (codesandbox#2575)
* 🔨 Switch ActionsZeit to use useOvermind * Fix types
1 parent 234dbb7 commit 78bdc0d

File tree

1 file changed

+19
-10
lines changed
  • packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Zeit/Deploys/Actions

1 file changed

+19
-10
lines changed
Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,36 @@
1-
import { inject, hooksObserver } from 'app/componentConnectors';
2-
import React from 'react';
1+
import {
2+
ZeitDeployment,
3+
ZeitDeploymentState,
4+
} from '@codesandbox/common/lib/types';
5+
import React, { FunctionComponent } from 'react';
6+
7+
import { useOvermind } from 'app/overmind';
38

49
import { ButtonContainer } from '../../../elements';
510

611
import { AliasDeploymentButton } from './AliasDeploymentButton';
712
import { DeleteDeploymentButton } from './DeleteDeploymentButton';
813
import { VisitDeploymentButton } from './VisitDeploymentButton';
9-
import { Deploy } from './types';
1014

1115
type Props = {
12-
deploy: Deploy;
13-
store: any;
16+
deploy: ZeitDeployment;
1417
};
15-
export const Actions = inject('store')(
16-
hooksObserver(({ deploy, store: { deployment: { hasAlias } } }: Props) => (
18+
export const Actions: FunctionComponent<Props> = ({ deploy }) => {
19+
const {
20+
state: {
21+
deployment: { hasAlias },
22+
},
23+
} = useOvermind();
24+
25+
return (
1726
<ButtonContainer>
1827
<VisitDeploymentButton url={deploy.url} />
1928

2029
<DeleteDeploymentButton id={deploy.uid} />
2130

22-
{hasAlias && deploy.state === 'READY' ? (
31+
{hasAlias && deploy.state === ZeitDeploymentState.READY ? (
2332
<AliasDeploymentButton deploy={deploy} />
2433
) : null}
2534
</ButtonContainer>
26-
))
27-
);
35+
);
36+
};

0 commit comments

Comments
 (0)