Skip to content

Commit 13debe3

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
🔨 Switch ZeitIntegration to use useOvermind (codesandbox#2531)
1 parent 186e9b6 commit 13debe3

File tree

1 file changed

+24
-27
lines changed
  • packages/app/src/app/pages/common/ZeitIntegration

1 file changed

+24
-27
lines changed
Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
1-
import React from 'react';
2-
import { inject, hooksObserver } from 'app/componentConnectors';
1+
import React, { FunctionComponent } from 'react';
2+
33
import { Integration } from 'app/components/Integration';
44
import { ZeitLogo } from 'app/components/ZeitLogo';
5+
import { useOvermind } from 'app/overmind';
56

6-
interface Props {
7+
type Props = {
78
small: boolean;
8-
store: any;
9-
signals: any;
10-
}
9+
};
10+
export const ZeitIntegration: FunctionComponent<Props> = ({ small }) => {
11+
const {
12+
actions: { signInZeitClicked, signOutZeitClicked },
13+
state: { user, isLoadingZeit },
14+
} = useOvermind();
1115

12-
export const ZeitIntegration = inject('store', 'signals')(
13-
hooksObserver(
14-
({
15-
small,
16-
signals: { signInZeitClicked, signOutZeitClicked },
17-
store: { user, isLoadingZeit },
18-
}: Props) => (
19-
<Integration
20-
name="ZEIT"
21-
small={small}
22-
bgColor="black"
23-
description="Deployments"
24-
Icon={ZeitLogo}
25-
userInfo={user.integrations.zeit}
26-
onSignIn={signInZeitClicked}
27-
onSignOut={signOutZeitClicked}
28-
loading={isLoadingZeit}
29-
/>
30-
)
31-
)
32-
);
16+
return (
17+
<Integration
18+
name="ZEIT"
19+
small={small}
20+
bgColor="black"
21+
description="Deployments"
22+
Icon={ZeitLogo}
23+
userInfo={user.integrations.zeit}
24+
onSignIn={signInZeitClicked}
25+
onSignOut={signOutZeitClicked}
26+
loading={isLoadingZeit}
27+
/>
28+
);
29+
};

0 commit comments

Comments
 (0)