|
1 | | -import { inject, hooksObserver } from 'app/componentConnectors'; |
2 | | -import React from 'react'; |
| 1 | +import React, { FunctionComponent } from 'react'; |
| 2 | + |
3 | 3 | import { DeploymentIntegration } from 'app/components/DeploymentIntegration'; |
4 | 4 | import { NowLogo } from 'app/components/NowLogo'; |
| 5 | +import { useOvermind } from 'app/overmind'; |
| 6 | + |
5 | 7 | import { DeployButtonContainer } from '../../elements'; |
6 | 8 |
|
7 | 9 | type Props = { |
8 | 10 | isOpen: boolean; |
9 | 11 | toggle: () => void; |
10 | | - store: any; |
11 | | - signals: any; |
12 | 12 | }; |
13 | 13 |
|
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