Skip to content

Commit f1dc8a6

Browse files
committed
Fix TypeScript errors
1 parent 790cf79 commit f1dc8a6

File tree

4 files changed

+24
-14
lines changed

4 files changed

+24
-14
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
import VERSION from '@codesandbox/common/lib/version';
22
import { observer } from 'mobx-react-lite';
33
import React from 'react';
4+
// Fix css prop types in styled-components (see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31245#issuecomment-463640878)
5+
import * as CSSProps from 'styled-components/cssprop'; // eslint-disable-line
46

57
import SocialInfo from 'app/components/SocialInfo';
68
import { useStore } from 'app/store';
79
import getWorkspaceItems from 'app/store/modules/workspace/items';
810

11+
import ConfigurationFiles from './items/ConfigurationFiles';
12+
import { Deployment } from './items/Deployment';
913
import Files from './items/Files';
10-
import ProjectInfo from './items/ProjectInfo';
1114
import { GitHub } from './items/GitHub';
12-
import Server from './items/Server';
1315
import Live from './items/Live';
1416
import { More } from './items/More';
15-
import { Deployment } from './items/Deployment';
16-
import ConfigurationFiles from './items/ConfigurationFiles';
1717
import { NotOwnedSandboxInfo } from './items/NotOwnedSandboxInfo';
18+
import ProjectInfo from './items/ProjectInfo';
19+
import Server from './items/Server';
1820

1921
import { Advertisement } from './Advertisement';
2022
import Chat from './Chat';

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { observer } from 'mobx-react-lite';
12
import React, { useEffect } from 'react';
23

34
import { useSignals } from 'app/store';
@@ -7,7 +8,7 @@ import { Description } from '../../elements';
78
import { Netlify } from './Netlify';
89
import { Zeit } from './Zeit';
910

10-
export const Deployment = () => {
11+
export const Deployment = observer(() => {
1112
const {
1213
deployment: { getDeploys },
1314
} = useSignals();
@@ -28,4 +29,4 @@ export const Deployment = () => {
2829
<Netlify />
2930
</div>
3031
);
31-
};
32+
});

packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Netlify.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const getFunctionDir = sandbox => {
3232
sandbox.directories
3333
);
3434
} catch (e) {
35-
return [];
35+
return null;
3636
}
3737
};
3838

packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/elements.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ export const Deploy = styled.li`
5555
flex-direction: column;
5656
`;
5757

58+
type NameProps = {
59+
light?: boolean;
60+
theme: any;
61+
};
5862
export const Name = styled.span`
59-
${({ light, theme }: { light: boolean; theme: any }) => css`
63+
${({ light, theme }: NameProps) => css`
6064
font-weight: 600;
6165
color: ${theme.light || light
6266
? css`rgba(0, 0, 0, 0.8)`
@@ -75,8 +79,12 @@ export const Name = styled.span`
7579
`};
7680
`;
7781

82+
type LinkProps = {
83+
disabled?: boolean;
84+
theme: any;
85+
};
7886
export const Link = styled.a`
79-
${({ disabled, theme }: { disabled: boolean; theme: any }) => css`
87+
${({ disabled, theme }: LinkProps) => css`
8088
padding: 0.25rem 0.4rem;
8189
background-color: ${theme.secondary};
8290
text-decoration: none;
@@ -111,22 +119,21 @@ export const Action = Link.withComponent('button');
111119

112120
export const ButtonContainer = styled.section`
113121
display: flex;
122+
114123
> *:not(:last-child) {
115124
margin-right: 0.5rem;
116125
}
117126
`;
118127

119128
export const DeploysWrapper = styled.div`
120-
background: rgb(0, 0, 0);
129+
background-color: #000000;
121130
border-radius: 4px;
122131
font-size: 0.875rem;
123132
color: rgba(255, 255, 255, 0.8);
124-
padding: 0.75rem 1rem;
125-
padding: 0.75rem 0rem;
133+
padding: 0.75rem 0;
126134
border-top-right-radius: 0;
127135
border-top-left-radius: 0;
128-
margin: 0.5rem 0.75rem;
129-
margin-top: 0;
136+
margin: 0 0.75rem 0.5rem;
130137
`;
131138

132139
export const Wrapper = styled.div`

0 commit comments

Comments
 (0)