Skip to content

Commit b61dbae

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
🔨 Switch SignInButton to use useOvermind (codesandbox#2529)
* 🔨 Switch SignInButton to use useOvermind * Fix types
1 parent cf79016 commit b61dbae

File tree

1 file changed

+14
-9
lines changed
  • packages/app/src/app/pages/common/SignInButton

1 file changed

+14
-9
lines changed

‎packages/app/src/app/pages/common/SignInButton/index.tsx‎

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
import * as React from 'react';
2-
import { inject, observer } from 'app/componentConnectors';
3-
4-
import GithubIcon from 'react-icons/lib/go/mark-github';
51
import { Button } from '@codesandbox/common/lib/components/Button';
62
import Row from '@codesandbox/common/lib/components/flex/Row';
3+
import React, { ComponentProps, FunctionComponent } from 'react';
4+
import GithubIcon from 'react-icons/lib/go/mark-github';
75

8-
const SignInButtonComponent = (props: any) => {
9-
const { signInClicked } = props.signals;
6+
import { useOvermind } from 'app/overmind';
7+
8+
type Props = Omit<ComponentProps<typeof Button>, 'onClick' | 'small'>;
9+
export const SignInButton: FunctionComponent<Props> = props => {
10+
const {
11+
actions: { signInClicked },
12+
} = useOvermind();
1013

1114
return (
12-
<Button small onClick={signInClicked} {...props}>
15+
<Button
16+
{...props}
17+
onClick={() => signInClicked({ useExtraScopes: false })}
18+
small
19+
>
1320
<Row>
1421
<GithubIcon style={{ marginRight: '0.5rem' }} /> Sign in with GitHub
1522
</Row>
1623
</Button>
1724
);
1825
};
19-
20-
export const SignInButton = inject('signals')(observer(SignInButtonComponent));

0 commit comments

Comments
 (0)