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' ;
44import { ZeitIntegration } from 'app/pages/common/ZeitIntegration' ;
55
66import { Wrapper } from '../elements' ;
@@ -9,29 +9,27 @@ import { DeployButton } from './DeployButton';
99import { Deploys } from './Deploys' ;
1010import { 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