Skip to content

Commit dd6b3eb

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
🔨 Switch GithubIntegration to use useOvermind (#2523)
* 🔨 Switch GithubIntegration to use useOvermind * Fix types
1 parent e41965b commit dd6b3eb

File tree

1 file changed

+30
-30
lines changed
  • packages/app/src/app/pages/common/GithubIntegration

1 file changed

+30
-30
lines changed
Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
import { inject, hooksObserver } from 'app/componentConnectors';
2-
import React from 'react';
3-
import GithubLogo from 'react-icons/lib/go/mark-github';
1+
import React, { FunctionComponent } from 'react';
2+
import GitHubLogo from 'react-icons/lib/go/mark-github';
3+
44
import { Integration } from 'app/components/Integration';
5+
import { useOvermind } from 'app/overmind';
56

67
type Props = {
78
small?: boolean;
8-
store: any;
9-
signals: any;
109
};
11-
export const GithubIntegration = inject('store', 'signals')(
12-
hooksObserver(
13-
({
14-
small = false,
15-
signals: { signInGithubClicked, signOutGithubIntegration },
16-
store: {
17-
isLoadingGithub,
18-
user: {
19-
integrations: { github },
20-
},
10+
export const GithubIntegration: FunctionComponent<Props> = ({
11+
small = false,
12+
}) => {
13+
const {
14+
actions: { signInGithubClicked, signOutGithubIntegration },
15+
state: {
16+
isLoadingGithub,
17+
user: {
18+
integrations: { github },
2119
},
22-
}: Props) => (
23-
<Integration
24-
bgColor="#4078c0"
25-
description={small ? 'Commits & PRs' : 'Committing & Pull Requests'}
26-
Icon={GithubLogo}
27-
loading={isLoadingGithub}
28-
name="GitHub"
29-
onSignIn={() => signInGithubClicked({ useExtraScopes: true })}
30-
onSignOut={signOutGithubIntegration}
31-
small={small}
32-
userInfo={github}
33-
/>
34-
)
35-
)
36-
);
20+
},
21+
} = useOvermind();
22+
23+
return (
24+
<Integration
25+
bgColor="#4078c0"
26+
description={small ? 'Commits & PRs' : 'Committing & Pull Requests'}
27+
Icon={GitHubLogo}
28+
loading={isLoadingGithub}
29+
name="GitHub"
30+
onSignIn={() => signInGithubClicked()}
31+
onSignOut={() => signOutGithubIntegration()}
32+
small={small}
33+
userInfo={github}
34+
/>
35+
);
36+
};

0 commit comments

Comments
 (0)