Skip to content

Commit fce4193

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
🔨 Switch DeployButtonZeit to use useOvermind (codesandbox#2573)
1 parent 9355b50 commit fce4193

File tree

1 file changed

+29
-35
lines changed
  • packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Zeit/DeployButton

1 file changed

+29
-35
lines changed
Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,38 @@
1-
import { inject, hooksObserver } from 'app/componentConnectors';
2-
import React from 'react';
1+
import React, { FunctionComponent } from 'react';
2+
33
import { DeploymentIntegration } from 'app/components/DeploymentIntegration';
44
import { NowLogo } from 'app/components/NowLogo';
5+
import { useOvermind } from 'app/overmind';
6+
57
import { DeployButtonContainer } from '../../elements';
68

79
type Props = {
810
isOpen: boolean;
911
toggle: () => void;
10-
store: any;
11-
signals: any;
1212
};
1313

14-
export const DeployButton = inject('store', 'signals')(
15-
hooksObserver(
16-
({
17-
isOpen,
18-
toggle,
19-
signals: {
20-
deployment: { deploySandboxClicked },
21-
},
22-
}: Props) => (
23-
<DeployButtonContainer>
24-
<DeploymentIntegration
25-
bgColor="#000000"
26-
onDeploy={deploySandboxClicked}
27-
Icon={NowLogo}
28-
name="Now"
29-
open={isOpen}
30-
onToggle={toggle}
31-
>
32-
Deploy your sandbox on{' '}
33-
<a
34-
href="https://zeit.co/now"
35-
rel="noreferrer noopener"
36-
target="_blank"
37-
>
38-
<span>ZEIT Now</span>
39-
</a>
40-
</DeploymentIntegration>
41-
</DeployButtonContainer>
42-
)
43-
)
44-
);
14+
export const DeployButton: FunctionComponent<Props> = ({ isOpen, toggle }) => {
15+
const {
16+
actions: {
17+
deployment: { deploySandboxClicked },
18+
},
19+
} = useOvermind();
20+
21+
return (
22+
<DeployButtonContainer>
23+
<DeploymentIntegration
24+
bgColor="#000000"
25+
onDeploy={deploySandboxClicked}
26+
Icon={NowLogo}
27+
name="Now"
28+
open={isOpen}
29+
onToggle={toggle}
30+
>
31+
Deploy your sandbox on{' '}
32+
<a href="https://zeit.co/now" rel="noreferrer noopener" target="_blank">
33+
<span>ZEIT Now</span>
34+
</a>
35+
</DeploymentIntegration>
36+
</DeployButtonContainer>
37+
);
38+
};

0 commit comments

Comments
 (0)