Skip to content

Commit cede771

Browse files
SaraVieiraCompuIves
authored andcommitted
* netlify start * Rename zeit.js to Zeit.js * update session id * add claim * lets try * design changes * fix site id * more things * add poll * fix url * re add cxjs * add building state * make it ts * fix ts * revert to js * fix template shjowing netlify * make workflow better for new sites * add logs * change url and interval * add dots * add beta notice * add styleguidist
1 parent 3ad5497 commit cede771

File tree

37 files changed

+589
-111
lines changed

37 files changed

+589
-111
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"lerna": "^2.5.1",
7777
"lint-staged": "^5.0.0",
7878
"prettier": "^1.8.2",
79-
"typescript": "^3.3.1"
79+
"typescript": "^3.3.1"
8080
},
8181
"dependencies": {
8282
"opencollective": "^1.0.3"

packages/app/config/babel.prod.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const path = require('path');
2-
31
module.exports = {
42
// Don't try to find .babelrc because we want to force this configuration.
53
babelrc: false,

packages/app/src/app/components/DeploymentIntegration/DetailInfo/elements.js

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,16 @@ export const Details = styled.div`
77
flex: 3;
88
padding: 0.75rem 1rem;
99
background-color: ${props => props.bgColor};
10+
margin-top: -1px;
1011
`;
1112

1213
export const Heading = styled.div`
13-
color: ${props =>
14-
props.theme.light ? 'rgba(0, 0, 0, 0.5)' : 'rgba(255, 255, 255, 0.5)'};
14+
color: ${props => (props.light ? 'rgba(0, 0, 0)' : 'rgba(255, 255, 255)')};
1515
font-size: 0.75rem;
1616
margin-bottom: 0.25rem;
1717
`;
1818

1919
export const Info = styled.div`
2020
font-weight: 400;
21-
`;
22-
23-
export const Action = styled.div`
24-
display: flex;
25-
transition: 0.3s ease all;
26-
border: 1px solid
27-
${props => (props.red ? 'rgba(255, 0, 0, 0.4)' : props.theme.secondary)};
28-
border-radius: 4px;
29-
30-
justify-content: center;
31-
align-items: center;
32-
33-
color: ${props => (props.red ? 'rgba(255, 0, 0, 0.6)' : 'white')};
34-
35-
background-color: ${props =>
36-
props.red ? 'transparent' : props.theme.secondary};
37-
38-
opacity: 0.8;
39-
cursor: pointer;
40-
41-
height: 1.5rem;
42-
width: 1.5rem;
43-
44-
&:hover {
45-
opacity: 1;
46-
47-
color: white;
48-
background-color: ${props =>
49-
props.red ? 'rgba(255, 0, 0, 0.6)' : props.theme.secondary};
50-
}
21+
color: ${props => (props.light ? 'rgba(0, 0, 0)' : 'rgba(255, 255, 255)')};
5122
`;

packages/app/src/app/components/DeploymentIntegration/DetailInfo/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { Button } from '@codesandbox/common/lib/components/Button';
44

55
import { Details, Info } from './elements';
66

7-
function DetailInfo({ info, deploy, bgColor }) {
7+
function DetailInfo({ info, deploy, bgColor, light, loading }) {
88
return (
99
<Details bgColor={bgColor}>
1010
<Margin right={2}>
11-
<Info>{info}</Info>
11+
<Info light={light}>{info}</Info>
1212
</Margin>
13-
<Button small onClick={deploy}>
13+
<Button small disabled={loading} onClick={deploy}>
1414
Deploy
1515
</Button>
1616
</Details>

packages/app/src/app/components/DeploymentIntegration/elements.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,26 @@ export const Container = styled.div`
99
font-size: 0.875rem;
1010
1111
color: ${props =>
12-
props.theme.light ? '#636363' : 'rgba(255, 255, 255, 0.8)'};
12+
props.light || props.theme.light ? 'rgba(0, 0, 0)' : 'rgba(255, 255, 255)'};
1313
1414
${props =>
1515
props.loading &&
1616
css`
1717
opacity: 0.5;
18+
pointer-events: none;
1819
`};
1920
`;
2021

2122
export const IntegrationBlock = styled.div`
2223
display: inline-flex;
2324
align-items: center;
25+
cursor: pointer;
26+
box-sizing: border-box;
2427
background-color: ${props => props.bgColor};
2528
flex: 1;
2629
color: white;
2730
padding: 0.75em 0.75em;
31+
min-height: 45px;
2832
font-size: 1em;
2933
justify-content: space-between;
3034
@@ -37,4 +41,5 @@ export const IntegrationBlock = styled.div`
3741
export const Name = styled.span`
3842
margin-left: 0.75em;
3943
font-size: 1.375em;
44+
color: ${props => (props.light ? 'rgba(0, 0, 0)' : 'rgba(255, 255, 255)')};
4045
`;
Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,69 @@
11
import React from 'react';
22
import Down from 'react-icons/lib/fa/angle-down';
33
import Up from 'react-icons/lib/fa/angle-up';
4+
import Notice from 'common/lib/components/Notice';
45
import DetailInfo from './DetailInfo';
56
import { Container, IntegrationBlock, Name } from './elements';
67

7-
function Integration({
8+
const Integration = ({
9+
light,
810
Icon,
911
name,
1012
deploy,
1113
children,
12-
color,
1314
loading,
15+
beta,
16+
color,
1417
open = true,
1518
toggle,
16-
}) {
17-
return (
18-
<Container loading={loading}>
19-
<IntegrationBlock bgColor={color}>
20-
<div>
21-
<Icon />
22-
<Name>{name}</Name>
23-
</div>
24-
{open ? (
25-
<Up
26-
css={`
27-
cursor: pointer;
28-
width: 1.5rem;
29-
height: auto;
30-
`}
31-
onClick={toggle}
32-
/>
33-
) : (
34-
<Down
19+
}) => (
20+
<Container>
21+
<IntegrationBlock bgColor={color} onClick={toggle}>
22+
<div>
23+
<Icon />
24+
<Name light={light}>{name}</Name>
25+
{beta && (
26+
<Notice
3527
css={`
36-
cursor: pointer;
37-
width: 1.5rem;
38-
height: auto;
28+
margin-left: 0.7rem;
3929
`}
40-
onClick={toggle}
41-
/>
30+
>
31+
Beta
32+
</Notice>
4233
)}
43-
</IntegrationBlock>
34+
</div>
4435
{open ? (
45-
<DetailInfo deploy={deploy} info={children} bgColor={color} />
46-
) : null}
47-
</Container>
48-
);
49-
}
36+
<Up
37+
css={`
38+
fill: ${light ? '#000' : '#fff'};
39+
cursor: pointer;
40+
width: 1.5rem;
41+
height: auto;
42+
`}
43+
onClick={toggle}
44+
/>
45+
) : (
46+
<Down
47+
css={`
48+
fill: ${light ? '#000' : '#fff'};
49+
cursor: pointer;
50+
width: 1.5rem;
51+
height: auto;
52+
`}
53+
onClick={toggle}
54+
/>
55+
)}
56+
</IntegrationBlock>
57+
{open ? (
58+
<DetailInfo
59+
loading={loading}
60+
light={light}
61+
deploy={deploy}
62+
info={children}
63+
bgColor={color}
64+
/>
65+
) : null}
66+
</Container>
67+
);
5068

5169
export default Integration;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react';
2+
import IconBase from 'react-icons/IconBase';
3+
4+
function NetlifyLogo({ className }) {
5+
return (
6+
<IconBase className={className} viewBox="0 0 14 14">
7+
<defs>
8+
<path
9+
id="a"
10+
d="M7 .2l6 5.9c.2.2.2.7 0 1l-6 5.8c-.2.3-.7.3-1 0L.3 7.1a.7.7 0 0 1 0-1L6.1.2c.2-.3.7-.3 1 0z"
11+
/>
12+
</defs>
13+
<use
14+
fill="#00AD9F"
15+
fillRule="evenodd"
16+
transform="translate(.4 .4)"
17+
xlinkHref="#a"
18+
/>
19+
</IconBase>
20+
);
21+
}
22+
23+
export default NetlifyLogo;

packages/app/src/app/pages/Sandbox/Editor/Workspace/Git/elements.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,3 @@ export const ErrorMessage = styled.div`
1919
margin: 1rem;
2020
font-size: 0.875rem;
2121
`;
22-
23-
export const Notice = styled.div`
24-
font-size: 0.75rem;
25-
color: white;
26-
padding: 0.125rem 0.2rem;
27-
background-image: linear-gradient(
28-
45deg,
29-
${({ theme }) => theme.secondary.darken(0.2)} 0%,
30-
${({ theme }) => theme.secondary.darken(0.1)} 100%
31-
);
32-
border-radius: 4px;
33-
float: right;
34-
margin-right: 2rem;
35-
`;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ import Margin from '@codesandbox/common/lib/components/spacing/Margin';
55
import GithubBadge from '@codesandbox/common/lib/components/GithubBadge';
66
import { githubRepoUrl } from '@codesandbox/common/lib/utils/url-generator';
77
import { Button } from '@codesandbox/common/lib/components/Button';
8+
import Notice from '@codesandbox/common/lib/components/Notice';
89
import Input, { TextArea } from '@codesandbox/common/lib/components/Input';
910

1011
import TotalChanges from './TotalChanges';
1112
import { WorkspaceSubtitle, WorkspaceInputContainer } from '../elements';
1213

13-
import { Container, Buttons, ErrorMessage, Notice } from './elements';
14+
import { Container, Buttons, ErrorMessage } from './elements';
1415

1516
function hasWriteAccess(rights: 'none' | 'read' | 'write' | 'admin') {
1617
return rights === 'write' || rights === 'admin';

packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Elements.js

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import styled from 'styled-components';
1+
import styled, { css } from 'styled-components';
22

33
const mapColorToState = (state, theme) => {
44
const STARTING = ['DEPLOYING', 'BUILDING', 'INITIALIZING'];
@@ -13,21 +13,6 @@ const mapColorToState = (state, theme) => {
1313
return theme.gray;
1414
};
1515

16-
export const Deploys = styled.ul`
17-
list-style: none;
18-
padding: 0;
19-
margin-top: 1rem;
20-
flex-direction: column;
21-
font-size: 0.875rem;
22-
margin: 0 0.25rem;
23-
`;
24-
25-
export const Deploy = styled.li`
26-
display: flex;
27-
margin-bottom: 1.5rem;
28-
flex-direction: column;
29-
`;
30-
3116
export const State = styled.span`
3217
align-items: center;
3318
display: flex;
@@ -45,18 +30,35 @@ export const State = styled.span`
4530
}
4631
`;
4732

33+
export const Deploys = styled.ul`
34+
list-style: none;
35+
padding: 0;
36+
margin-top: 1rem;
37+
flex-direction: column;
38+
font-size: 0.875rem;
39+
margin: 0 0.25rem;
40+
`;
41+
42+
export const Deploy = styled.li`
43+
display: flex;
44+
margin-bottom: 1.5rem;
45+
flex-direction: column;
46+
`;
47+
4848
export const Name = styled.span`
4949
font-weight: 600;
5050
color: ${props =>
51-
props.theme.light ? 'rgba(0, 0, 0, 0.8)' : 'rgba(255, 255, 255, 0.8)'};
51+
props.theme.light || props.light
52+
? 'rgba(0, 0, 0, 0.8)'
53+
: 'rgba(255, 255, 255, 0.8)'};
5254
font-size: 1rem;
5355
margin-top: 0;
5456
margin-bottom: 0.5rem;
5557
vertical-align: middle;
5658
5759
span {
5860
color: ${props =>
59-
props.theme.light
61+
props.theme.light || props.light
6062
? props.theme.background3.darken(0.5)
6163
: props.theme.background3.lighten(0.5)};
6264
font-size: 12px;
@@ -74,6 +76,21 @@ export const Link = styled.a`
7476
border-radius: 2px;
7577
font-weight: 600;
7678
margin-top: 0.75rem;
79+
display: flex;
80+
align-items: center;
81+
flex-grow: 0;
82+
max-width: 50%;
83+
84+
svg {
85+
margin-right: 10px;
86+
}
87+
88+
${props =>
89+
props.disabled &&
90+
css`
91+
background: ${props.theme.gray};
92+
pointer-events: none;
93+
`};
7794
7895
&:disabled {
7996
background: ${props => props.theme.gray};
@@ -101,3 +118,13 @@ export const DeploysWrapper = styled.div`
101118
margin: 0.5rem 0.75rem;
102119
margin-top: 0;
103120
`;
121+
122+
export const Wrapper = styled.div`
123+
opacity: 1;
124+
${props =>
125+
props.loading &&
126+
css`
127+
opacity: 0.5;
128+
pointer-events: none;
129+
`};
130+
`;

0 commit comments

Comments
 (0)