Skip to content

Commit db43145

Browse files
committed
Fix TypeScript errors
1 parent 3db3820 commit db43145

File tree

6 files changed

+37
-17
lines changed

6 files changed

+37
-17
lines changed

packages/app/src/app/pages/Sandbox/Editor/Workspace/WorkspaceItem/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
} from './elements';
1111

1212
type Props = {
13-
children: React.ReactChildren;
13+
children: React.ReactNode;
1414
title: string;
1515
keepState?: boolean;
1616
disabled?: boolean;

packages/app/src/app/pages/Sandbox/Editor/Workspace/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import * as React from 'react';
2-
import { inject, observer } from 'mobx-react';
3-
41
import VERSION from '@codesandbox/common/lib/version';
2+
import { inject, observer } from 'mobx-react';
3+
import * as React from 'react';
4+
// Fix css prop types in styled-components (see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31245#issuecomment-463640878)
5+
import {} from 'styled-components/cssprop';
56

6-
import getWorkspaceItems from 'app/store/modules/workspace/items';
77
import SocialInfo from 'app/components/SocialInfo';
8+
import getWorkspaceItems from 'app/store/modules/workspace/items';
89

910
import Files from './items/Files';
1011
import ProjectInfo from './items/ProjectInfo';

packages/app/src/app/pages/Sandbox/Editor/Workspace/items/GitHub/CreateRepo/CreateRepo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { useSignals, useStore } from 'app/store';
1313
import { Error } from './elements';
1414

1515
type Props = {
16-
style: React.CSSProperties;
16+
style?: React.CSSProperties;
1717
};
1818
export const CreateRepo = observer(({ style }: Props) => {
1919
const {

packages/app/src/app/pages/Sandbox/Editor/Workspace/items/GitHub/Git/Git.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const Git = observer(() => {
4747
}: React.ChangeEvent<HTMLInputElement>) => subjectChanged({ subject: value });
4848
const changeDescription = ({
4949
target: { value },
50-
}: React.ChangeEvent<HTMLInputElement>) =>
50+
}: React.ChangeEvent<HTMLTextAreaElement>) =>
5151
descriptionChanged({ description: value });
5252

5353
const modulesNotSaved = !isAllModulesSynced;

packages/app/src/app/pages/Sandbox/Editor/Workspace/items/GitHub/GitHub.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ export const GitHub = observer(() => {
3838
)
3939
) : (
4040
<>
41-
<Description margin={1} top={0}>
41+
<Description
42+
css={`
43+
margin: 1;
44+
top: 0;
45+
`}
46+
>
4247
You can create commits and open pull requests if you add GitHub to your
4348
integrations.
4449
</Description>
Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,36 @@
1+
import { observer } from 'mobx-react-lite';
12
import React from 'react';
2-
import { inject, observer } from 'mobx-react';
33
import GithubLogo from 'react-icons/lib/go/mark-github';
4+
45
import Integration from 'app/components/Integration';
6+
import { useSignals, useStore } from 'app/store';
7+
8+
type Props = {
9+
small?: boolean,
10+
};
11+
12+
const GithubIntegration = ({ small }: Props) => {
13+
const { signInGithubClicked, signOutGithubIntegration } = useSignals();
14+
const {
15+
isLoadingGithub,
16+
signOutGithubIntegration: {
17+
integrations: { github },
18+
},
19+
} = useStore();
520

6-
function GithubIntegration({ store, signals, small }) {
721
return (
822
<Integration
9-
name="GitHub"
1023
color="#4078c0"
1124
description={small ? 'Commits & PRs' : 'Committing & Pull Requests'}
1225
Icon={GithubLogo}
26+
loading={isLoadingGithub}
27+
name="GitHub"
28+
signIn={() => signInGithubClicked({ useExtraScopes: true })}
29+
signOut={signOutGithubIntegration}
1330
small={small}
14-
userInfo={store.user.integrations.github}
15-
signOut={() => signals.signOutGithubIntegration()}
16-
signIn={() => signals.signInGithubClicked({ useExtraScopes: true })}
17-
loading={store.isLoadingGithub}
31+
userInfo={github}
1832
/>
1933
);
20-
}
34+
};
2135

22-
export default inject('store', 'signals')(observer(GithubIntegration));
36+
export default observer(GithubIntegration);

0 commit comments

Comments
 (0)