Skip to content

Commit 4912e97

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
🔨 Switch Zeit to use useOvermind (codesandbox#2570)
1 parent d4673e1 commit 4912e97

File tree

1 file changed

+25
-27
lines changed
  • packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Zeit

1 file changed

+25
-27
lines changed
Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { inject, hooksObserver } from 'app/componentConnectors';
2-
import React, { useState } from 'react';
1+
import React, { FunctionComponent, useState } from 'react';
32

3+
import { useOvermind } from 'app/overmind';
44
import { ZeitIntegration } from 'app/pages/common/ZeitIntegration';
55

66
import { Wrapper } from '../elements';
@@ -9,29 +9,27 @@ import { DeployButton } from './DeployButton';
99
import { Deploys } from './Deploys';
1010
import { NoIntegrationWrapper } from './elements';
1111

12-
export const Zeit = inject('store')(
13-
hooksObserver(
14-
({
15-
store: {
16-
deployment: { deploying, sandboxDeploys },
17-
user: { integrations },
18-
},
19-
}) => {
20-
const [isVisible, setVisible] = useState(false);
21-
return integrations.zeit ? (
22-
<Wrapper loading={deploying}>
23-
<DeployButton
24-
isOpen={isVisible}
25-
toggle={() => setVisible(show => !show)}
26-
/>
12+
export const Zeit: FunctionComponent = () => {
13+
const {
14+
state: {
15+
deployment: { deploying, sandboxDeploys },
16+
user: { integrations },
17+
},
18+
} = useOvermind();
19+
const [isVisible, setVisible] = useState(false);
2720

28-
{sandboxDeploys.length && isVisible ? <Deploys /> : null}
29-
</Wrapper>
30-
) : (
31-
<NoIntegrationWrapper>
32-
<ZeitIntegration small />
33-
</NoIntegrationWrapper>
34-
);
35-
}
36-
)
37-
);
21+
return integrations.zeit ? (
22+
<Wrapper loading={deploying}>
23+
<DeployButton
24+
isOpen={isVisible}
25+
toggle={() => setVisible(show => !show)}
26+
/>
27+
28+
{sandboxDeploys.length && isVisible ? <Deploys /> : null}
29+
</Wrapper>
30+
) : (
31+
<NoIntegrationWrapper>
32+
<ZeitIntegration small />
33+
</NoIntegrationWrapper>
34+
);
35+
};

0 commit comments

Comments
 (0)