Skip to content

Commit 790cf79

Browse files
committed
Resolve discussions
1 parent 93485c5 commit 790cf79

File tree

4 files changed

+27
-13
lines changed

4 files changed

+27
-13
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export const Deployment = () => {
1212
deployment: { getDeploys },
1313
} = useSignals();
1414

15-
useEffect(() => getDeploys(), []); // eslint-disable-line
15+
useEffect(() => {
16+
getDeploys();
17+
}, [getDeploys]);
1618

1719
return (
1820
<div>

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ export const Netlify = observer(() => {
4545

4646
const [isVisible, setVisibility] = useState(false);
4747

48-
useEffect(() => getNetlifyDeploys(), []); // eslint-disable-line
48+
useEffect(() => {
49+
getNetlifyDeploys();
50+
}, [getNetlifyDeploys]);
4951

5052
const template = getTemplate(editor.currentSandbox.template);
5153
const functionDirectory = getFunctionDir(editor.currentSandbox);
@@ -61,7 +63,7 @@ export const Netlify = observer(() => {
6163
<DeploymentIntegration
6264
beta
6365
color="#FFFFFF"
64-
deploy={() => deployWithNetlify()}
66+
deploy={deployWithNetlify}
6567
Icon={NetlifyLogo}
6668
light
6769
loading={deployment.deploying || deployment.building}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const Zeit = observer(() => {
4141
<WorkspaceInputContainer style={{ marginTop: '1rem', marginBottom: 0 }}>
4242
<DeploymentIntegration
4343
color="#000000"
44-
deploy={() => deploySandboxClicked()}
44+
deploy={deploySandboxClicked}
4545
Icon={NowLogo}
4646
name="Now"
4747
open={isVisible}
@@ -73,7 +73,9 @@ export const Zeit = observer(() => {
7373
<Name>
7474
{deploy.name}
7575

76-
<span>({distanceInWordsToNow(deploy.created)} ago)</span>
76+
<span>{`(${distanceInWordsToNow(
77+
deploy.created
78+
)} ago)`}</span>
7779
</Name>
7880

7981
<State state={deploy.state}>

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ const mapColorToState = (state: string, theme: any) => {
55
const ERROR = ['DEPLOYMENT_ERROR', 'BUILD_ERROR', 'ERROR'];
66
const STARTED = ['BOOTED', 'READY'];
77

8-
if (STARTING.includes(state)) return '#fccb7e';
9-
if (ERROR.includes(state)) return theme.red;
10-
if (STARTED.includes(state)) return theme.green;
11-
if (state === 'FROZEN') return theme.blue;
8+
if (STARTING.includes(state)) {
9+
return '#fccb7e';
10+
}
11+
if (ERROR.includes(state)) {
12+
return theme.red;
13+
}
14+
if (STARTED.includes(state)) {
15+
return theme.green;
16+
}
17+
if (state === 'FROZEN') {
18+
return theme.blue;
19+
}
1220

1321
return theme.gray;
1422
};
@@ -29,7 +37,7 @@ export const State = styled.span`
2937
margin-right: 0.5rem;
3038
background: ${mapColorToState(state, theme)};
3139
}
32-
`}
40+
`};
3341
`;
3442

3543
export const Deploys = styled.ul`
@@ -64,7 +72,7 @@ export const Name = styled.span`
6472
font-size: 12px;
6573
margin-left: 0.5rem;
6674
}
67-
`}
75+
`};
6876
`;
6977

7078
export const Link = styled.a`
@@ -96,7 +104,7 @@ export const Link = styled.a`
96104
&:disabled {
97105
background: ${theme.gray};
98106
}
99-
`}
107+
`};
100108
`;
101109

102110
export const Action = Link.withComponent('button');
@@ -129,5 +137,5 @@ export const Wrapper = styled.div`
129137
opacity: 0.5;
130138
pointer-events: none;
131139
`};
132-
`}
140+
`};
133141
`;

0 commit comments

Comments
 (0)