Skip to content

Commit 22675e2

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
🔨 Switch DeployButtonNetlify to use useOvermind (codesandbox#2574)
1 parent 5775507 commit 22675e2

File tree

1 file changed

+37
-44
lines changed
  • packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Netlify/DeployButton

1 file changed

+37
-44
lines changed
Lines changed: 37 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,47 @@
1-
import React from 'react';
21
import track from '@codesandbox/common/lib/utils/analytics';
3-
import { inject, hooksObserver } from 'app/componentConnectors';
2+
import React, { FunctionComponent } from 'react';
3+
44
import { DeploymentIntegration } from 'app/components/DeploymentIntegration';
55
import { NetlifyLogo } from 'app/components/NetlifyLogo';
6+
import { useOvermind } from 'app/overmind';
7+
68
import { DeployButtonContainer } from '../../elements';
79

810
type Props = {
911
isOpen: boolean;
1012
toggle: () => void;
11-
store: any;
12-
signals: any;
1313
};
14+
export const DeployButton: FunctionComponent<Props> = ({ isOpen, toggle }) => {
15+
const {
16+
actions: {
17+
deployment: { deployWithNetlify },
18+
},
19+
state: {
20+
deployment: { building, deploying },
21+
},
22+
} = useOvermind();
1423

15-
export const DeployButton = inject('store', 'signals')(
16-
hooksObserver(
17-
({
18-
isOpen,
19-
toggle,
20-
signals: {
21-
deployment: { deployWithNetlify },
22-
},
23-
store: {
24-
deployment: { building, deploying },
25-
},
26-
}: Props) => (
27-
<DeployButtonContainer>
28-
<DeploymentIntegration
29-
beta
30-
bgColor="#FFFFFF"
31-
onDeploy={() => {
32-
track('Deploy Clicked', { provider: 'netlify' });
33-
deployWithNetlify({});
34-
}}
35-
Icon={NetlifyLogo}
36-
light
37-
loading={deploying || building}
38-
name="netlify"
39-
open={isOpen}
40-
onToggle={toggle}
41-
>
42-
Deploy your sandbox site on{' '}
43-
<a
44-
href="https://netlify.com"
45-
rel="noreferrer noopener"
46-
target="_blank"
47-
>
48-
<span>Netlify</span>
49-
</a>
50-
</DeploymentIntegration>
51-
</DeployButtonContainer>
52-
)
53-
)
54-
);
24+
return (
25+
<DeployButtonContainer>
26+
<DeploymentIntegration
27+
beta
28+
bgColor="#FFFFFF"
29+
onDeploy={() => {
30+
track('Deploy Clicked', { provider: 'netlify' });
31+
deployWithNetlify();
32+
}}
33+
Icon={NetlifyLogo}
34+
light
35+
loading={deploying || building}
36+
name="netlify"
37+
open={isOpen}
38+
onToggle={toggle}
39+
>
40+
Deploy your sandbox site on{' '}
41+
<a href="https://netlify.com" rel="noreferrer noopener" target="_blank">
42+
<span>Netlify</span>
43+
</a>
44+
</DeploymentIntegration>
45+
</DeployButtonContainer>
46+
);
47+
};

0 commit comments

Comments
 (0)