Skip to content

Commit 95849a2

Browse files
authored
July update (codesandbox#67)
* Algolia Search (codesandbox#65) * Add result filtering * Add default margin * Filter styling, GitHub icons * Tweaks * Improve Algolia search * Add search to header * Add search icons * Tag support * Add tags to search * Use new styles everywhere * Rename search titles * CodeSandbox Patron (codesandbox#66) * Add result filtering * Add default margin * Filter styling, GitHub icons * Tweaks * Improve Algolia search * Add search to header * Add search icons * Base pricing * Tag support * Add tags to search * Pricing page WIP * Slider * Badge work * Update particle animations * Remove second argument from raf * Add name to form * Finish subscription form * Rename to patron * Add Badges * Preferences * Use new styles everywhere * Rename search titles * Improve preferences * Payment details * Update user entity * Update payment details & add more badges * Patron and private sandboxes * Saving privacy status * Show private sandboxes on profile * Add notice * Show tags in search * Make tag names more clear * Add Stripe production key * Terms of Service * Update badges * Add legal urls * Load editor by default * Bring Notifications to the right * Change logo, adjust config * Hide badges * Change badge behaviour * Make better distinction between badge and patron * Adjust badge size * Tweaks to badge and fix title * Adjust badge position
1 parent 66e6a71 commit 95849a2

File tree

96 files changed

+4832
-350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+4832
-350
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"opn": "4.0.2",
5555
"path-exists": "3.0.0",
5656
"postcss-loader": "^1.2.1",
57-
"prettier": "CompuIves/custom-prettier-codesandbox",
57+
"prettier": "^1.5.2",
5858
"promise": "7.1.1",
5959
"raw-loader": "^0.5.1",
6060
"react-hot-loader": "^3.0.0-beta.6",
@@ -86,6 +86,7 @@
8686
"codemirror": "^5.27.4",
8787
"color": "^0.11.4",
8888
"cssnano": "^3.10.0",
89+
"custom-prettier-codesandbox": "CompuIves/custom-prettier-codesandbox",
8990
"debug": "^2.6.8",
9091
"file-saver": "^1.3.3",
9192
"glamor": "^2.20.25",
@@ -99,26 +100,30 @@
99100
"moment": "^2.18.1",
100101
"normalize.css": "^5.0.0",
101102
"normalizr": "^3.2.3",
103+
"rc-slider": "^8.2.0",
102104
"react": "^15.6.1",
103105
"react-addons-css-transition-group": "^15.6.0",
104106
"react-deep-force-update": "^2.0.1",
105107
"react-dnd": "^2.4.0",
106108
"react-dnd-html5-backend": "^2.4.1",
107109
"react-dom": "^15.6.1",
108110
"react-icons": "^2.2.5",
111+
"react-instantsearch": "^4.0.6",
109112
"react-loadable": "^3.3.1",
110113
"react-modal": "^2.2.1",
111114
"react-motion": "^0.5.0",
112115
"react-redux": "^5.0.5",
113116
"react-router-dom": "^4.1.1",
114117
"react-router-redux": "next",
115118
"react-split-pane": "^0.1.63",
119+
"react-stripe-elements": "^0.0.2",
116120
"react-tippy": "^0.14.0",
117121
"redbox-react": "^1.4.3",
118122
"redux": "^3.7.1",
119123
"reselect": "^3.0.1",
120124
"store": "^2.0.12",
121125
"styled-components": "^2.1.1",
126+
"svg-react-loader": "^0.4.4",
122127
"tern": "^0.21.0"
123128
},
124129
"scripts": {

src/app/components/Input.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
import styled from 'styled-components';
22

33
export default styled.input`
4+
transition: 0.3s ease border-color;
45
background-color: rgba(0, 0, 0, 0.3);
56
border: none;
67
outline: none;
78
border-radius: 4px;
8-
border: 1px solid rgba(0, 0, 0, .1);
99
color: white;
1010
padding: 0.25em;
1111
width: inherit;
1212
box-sizing: border-box;
13+
14+
border: 1px solid
15+
${props =>
16+
props.error ? props.theme.red.clearer(0.5) : 'rgba(0, 0, 0, 0.1)'};
17+
18+
&:focus {
19+
border-color: ${props => props.theme.secondary.clearer(0.6)};
20+
}
1321
`;

src/app/components/Preference/PreferenceNumber.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import React from 'react';
2+
import styled from 'styled-components';
23

34
import Input from 'app/components/Input';
45

6+
const StyledInput = styled(Input)`
7+
text-align: center;
8+
`;
9+
510
type Props = {
611
value: boolean,
712
setValue: boolean => any,
@@ -20,6 +25,8 @@ export default class PreferenceInput extends React.PureComponent {
2025

2126
render() {
2227
const { value } = this.props;
23-
return <Input type="number" value={value} onChange={this.handleChange} />;
28+
return (
29+
<StyledInput type="number" value={value} onChange={this.handleChange} />
30+
);
2431
}
2532
}

src/app/components/Switch.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ const Container = styled.div`
1212
position: relative;
1313
background-color: ${getColor};
1414
width: ${({ small }) => (small ? 3 : 3.5)}rem;
15-
color: rgba(0,0,0,0.5);
16-
border: 1px solid rgba(0,0,0,.1);
15+
color: rgba(0, 0, 0, 0.5);
16+
border: 1px solid rgba(0, 0, 0, .1);
1717
padding: 0.5rem;
1818
height: ${props => (props.small ? 20 : 26)}px;
1919
box-sizing: border-box;
2020
cursor: pointer;
2121
border-radius: 4px;
2222
23-
&:before, &:after {
23+
&:before,
24+
&:after {
2425
position: absolute;
2526
top: 50%;
2627
margin-top: -.5em;
@@ -29,7 +30,7 @@ const Container = styled.div`
2930
`;
3031

3132
const getSize = ({ small }) =>
32-
(small ? 'calc(1.5rem + 2px)' : 'calc(2rem + 2px)');
33+
small ? 'calc(1.5rem + 2px)' : 'calc(2rem + 2px)';
3334

3435
const Dot = styled.div`
3536
transition: inherit;
@@ -39,9 +40,9 @@ const Dot = styled.div`
3940
left: 0.1rem;
4041
border-radius: 4px;
4142
transform: translateX(${props => (props.right ? getSize(props) : '0')});
42-
top: ${({ small }) => (small ? `calc(0.1rem + 1px)` : `calc(0.1rem)`)};
43+
top: 0.1rem;
4344
background-color: white;
44-
box-shadow: 0 0 4px rgba(0,0,0,0.2);
45+
box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
4546
`;
4647

4748
type Props = {
@@ -58,7 +59,7 @@ export default ({
5859
secondary = false,
5960
offMode = false,
6061
small = false,
61-
}: Props) => (
62+
}: Props) =>
6263
<Container
6364
small={small}
6465
secondary={secondary}
@@ -67,5 +68,4 @@ export default ({
6768
right={right}
6869
>
6970
<Dot small={small} right={right} />
70-
</Container>
71-
);
71+
</Container>;

src/app/components/buttons/Button.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const styles = css`
4343
font-size: 1.125rem;
4444
text-align: center;
4545
color: ${props => getColor(props)};
46-
font-weight: 300;
46+
font-weight: 400;
4747
${props => !props.disabled && `box-shadow: 0 3px 3px rgba(0, 0, 0, 0.5);`};
4848
width: ${props => (props.block ? '100%' : 'inherit')};
4949
@@ -55,9 +55,7 @@ const styles = css`
5555
`;
5656
}
5757
return 'padding: 0.65rem 2.25rem;';
58-
}}
59-
60-
user-select: none;
58+
}} user-select: none;
6159
text-decoration: none;
6260
6361
${props =>
@@ -78,7 +76,7 @@ const styles = css`
7876
&:active {
7977
transform: translateY(1px);
8078
box-shadow: 0 0 0 rgba(0, 0, 0, 0.5);
81-
}`}
79+
}`};
8280
`;
8381
const LinkButton = styled(Link)`${styles}`;
8482
const AButton = styled.a`${styles};`;

src/app/components/buttons/__snapshots__/Button.test.js.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
exports[`Button renders 1`] = `
44
<button
5-
className="sc-htpNat iGlKTD"
5+
className="sc-htpNat hCsYOm"
66
>
77
Test
88
</button>
99
`;
1010

1111
exports[`Button renders disabled 1`] = `
1212
<button
13-
className="sc-htpNat fTFVBb"
13+
className="sc-htpNat hsOzQt"
1414
disabled={true}
1515
>
1616
Test
@@ -19,7 +19,7 @@ exports[`Button renders disabled 1`] = `
1919

2020
exports[`Button renders href 1`] = `
2121
<a
22-
className="sc-bwzfXH eBmlcd"
22+
className="sc-bwzfXH djbEWS"
2323
href="https://ivesvh.com"
2424
>
2525
Test
@@ -28,7 +28,7 @@ exports[`Button renders href 1`] = `
2828

2929
exports[`Button renders onClick 1`] = `
3030
<button
31-
className="sc-htpNat iGlKTD"
31+
className="sc-htpNat hCsYOm"
3232
onClick={[Function]}
3333
>
3434
Test
@@ -37,15 +37,15 @@ exports[`Button renders onClick 1`] = `
3737

3838
exports[`Button renders properties 1`] = `
3939
<button
40-
className="sc-htpNat dpXcLN"
40+
className="sc-htpNat cGrUyB"
4141
>
4242
Test
4343
</button>
4444
`;
4545

4646
exports[`Button renders to 1`] = `
4747
<a
48-
className="sc-bdVaJa gUBIAT"
48+
className="sc-bdVaJa dRYfIP"
4949
href="https://ivesvh.com"
5050
onClick={[Function]}
5151
>

src/app/components/flex/Centered.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import styled from 'styled-components';
33
export default styled.div`
44
position: relative;
55
display: flex;
6-
${props => props.horizontal && 'justify-content: center;'}
7-
${props => props.vertical && 'align-items: center;'}
8-
flex-direction: column;
6+
${props => props.vertical && 'justify-content: center;'} ${props =>
7+
props.horizontal && 'align-items: center;'} flex-direction: column;
98
width: 100%;
109
`;

src/app/components/sandbox/DeleteSandboxButton.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import styled from 'styled-components';
44
import DeleteIcon from 'react-icons/lib/md/delete';
55
import Tooltip from 'app/components/Tooltip';
66

7-
const DeleteSandboxButton = styled((props) => (
7+
const DeleteSandboxButton = styled(props =>
88
<Tooltip title="Delete Sandbox">
99
<button {...props}>
1010
<DeleteIcon />
1111
</button>
12-
</Tooltip>
13-
))`
12+
</Tooltip>,
13+
)`
1414
font-size: 1.2em;
1515
background-color: inherit;
1616
border: none;
@@ -23,20 +23,18 @@ const DeleteSandboxButton = styled((props) => (
2323
`;
2424

2525
type Props = {
26-
onDelete: Function;
27-
id: string;
26+
onDelete: Function,
27+
id: string,
2828
};
2929

3030
export default class DeleteSandboxButtonContainer extends React.PureComponent {
3131
props: Props;
3232

3333
deleteSandbox = () => {
3434
this.props.onDelete(this.props.id);
35-
}
35+
};
3636

3737
render() {
38-
return (
39-
<DeleteSandboxButton {...this.props} onClick={this.deleteSandbox} />
40-
)
38+
return <DeleteSandboxButton {...this.props} onClick={this.deleteSandbox} />;
4139
}
4240
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import React from 'react';
2+
import styled, { css } from 'styled-components';
3+
import Question from 'react-icons/lib/go/question';
4+
5+
import Unlisted from 'react-icons/lib/go/link';
6+
import Private from 'react-icons/lib/go/lock';
7+
8+
import Tooltip from '../Tooltip';
9+
10+
const iconStyles = css`
11+
opacity: 0.5;
12+
margin-left: 0.5em;
13+
margin-bottom: 0.2rem;
14+
`;
15+
16+
const StyledUnlisted = styled(Unlisted)(iconStyles);
17+
const StyledPrivate = styled(Private)(iconStyles);
18+
19+
const PRIVACY_MESSAGES = {
20+
0: {
21+
title: 'Public',
22+
tooltip: 'Everyone can see the sandbox',
23+
icon: null,
24+
},
25+
1: {
26+
title: 'Unlisted',
27+
tooltip: 'Only users with the url can see the sandbox',
28+
icon: <StyledUnlisted />,
29+
},
30+
2: {
31+
title: 'Private',
32+
tooltip: 'Only you can see the sandbox',
33+
icon: <StyledPrivate />,
34+
},
35+
};
36+
37+
const Icon = styled(Question)(iconStyles);
38+
39+
export default ({ privacy, asIcon }: { privacy: number, asIcon: boolean }) => {
40+
if (asIcon) {
41+
return (
42+
<Tooltip title={PRIVACY_MESSAGES[privacy].tooltip}>
43+
{PRIVACY_MESSAGES[privacy].icon}
44+
</Tooltip>
45+
);
46+
}
47+
48+
return (
49+
<Tooltip title={PRIVACY_MESSAGES[privacy].tooltip}>
50+
{PRIVACY_MESSAGES[privacy].title}
51+
<Icon />
52+
</Tooltip>
53+
);
54+
};

0 commit comments

Comments
 (0)