Skip to content

[WIP] Patron #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Jul 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3c8c10c
Base pricing
Jul 8, 2017
b8359be
Pricing page WIP
Jul 11, 2017
597114a
Slider
Jul 11, 2017
3941cfd
Merge branch 'add/search' into add/pricing
Jul 11, 2017
ba7d888
Badge work
Jul 11, 2017
cfcb460
Update particle animations
Jul 12, 2017
f11590c
Remove second argument from raf
Jul 13, 2017
ba4aba5
Add name to form
Jul 13, 2017
6bf58af
Finish subscription form
Jul 13, 2017
ba96cb1
Rename to patron
Jul 14, 2017
07382eb
Add Badges
Jul 14, 2017
fa8931f
Preferences
Jul 14, 2017
b3e63bb
Merge branch 'add/search' into add/pricing
Jul 14, 2017
480edee
Improve preferences
Jul 14, 2017
83a81fd
Payment details
Jul 16, 2017
acae8e7
Merge branch 'master' into add/pricing
Jul 16, 2017
209dd61
Merge branch 'add/search' into add/pricing
Jul 16, 2017
decc6fd
Update user entity
Jul 16, 2017
6aaf3b2
Update payment details & add more badges
Jul 16, 2017
66e5f18
Merge branch 'add/search' into add/pricing
Jul 16, 2017
13c0c9c
Patron and private sandboxes
Jul 19, 2017
a43e4d0
Saving privacy status
Jul 19, 2017
2cd8f23
Show private sandboxes on profile
Jul 19, 2017
d22951a
Add notice
Jul 19, 2017
4e87c6a
Show tags in search
Jul 19, 2017
dea92e4
Make tag names more clear
Jul 19, 2017
9450db1
Add Stripe production key
Jul 20, 2017
9fa1271
Terms of Service
Jul 20, 2017
32502cf
Update badges
Jul 20, 2017
1f32973
Add legal urls
Jul 20, 2017
ac81cdd
Load editor by default
Jul 20, 2017
b1832eb
Bring Notifications to the right
Jul 20, 2017
2737445
Change logo, adjust config
Jul 21, 2017
2264696
Hide badges
Jul 21, 2017
33035b2
Change badge behaviour
Jul 21, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"opn": "4.0.2",
"path-exists": "3.0.0",
"postcss-loader": "^1.2.1",
"prettier": "CompuIves/custom-prettier-codesandbox",
"prettier": "^1.5.2",
"promise": "7.1.1",
"raw-loader": "^0.5.1",
"react-hot-loader": "^3.0.0-beta.6",
Expand Down Expand Up @@ -86,6 +86,7 @@
"codemirror": "^5.27.4",
"color": "^0.11.4",
"cssnano": "^3.10.0",
"custom-prettier-codesandbox": "CompuIves/custom-prettier-codesandbox",
"debug": "^2.6.8",
"file-saver": "^1.3.3",
"glamor": "^2.20.25",
Expand All @@ -99,6 +100,7 @@
"moment": "^2.18.1",
"normalize.css": "^5.0.0",
"normalizr": "^3.2.3",
"rc-slider": "^8.2.0",
"react": "^15.6.1",
"react-addons-css-transition-group": "^15.6.0",
"react-deep-force-update": "^2.0.1",
Expand All @@ -114,12 +116,14 @@
"react-router-dom": "^4.1.1",
"react-router-redux": "next",
"react-split-pane": "^0.1.63",
"react-stripe-elements": "^0.0.2",
"react-tippy": "^0.14.0",
"redbox-react": "^1.4.3",
"redux": "^3.7.1",
"reselect": "^3.0.1",
"store": "^2.0.12",
"styled-components": "^2.1.1",
"svg-react-loader": "^0.4.4",
"tern": "^0.21.0"
},
"scripts": {
Expand Down
10 changes: 9 additions & 1 deletion src/app/components/Input.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import styled from 'styled-components';

export default styled.input`
transition: 0.3s ease border-color;
background-color: rgba(0, 0, 0, 0.3);
border: none;
outline: none;
border-radius: 4px;
border: 1px solid rgba(0, 0, 0, .1);
color: white;
padding: 0.25em;
width: inherit;
box-sizing: border-box;

border: 1px solid
${props =>
props.error ? props.theme.red.clearer(0.5) : 'rgba(0, 0, 0, 0.1)'};

&:focus {
border-color: ${props => props.theme.secondary.clearer(0.6)};
}
`;
9 changes: 8 additions & 1 deletion src/app/components/Preference/PreferenceNumber.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react';
import styled from 'styled-components';

import Input from 'app/components/Input';

const StyledInput = styled(Input)`
text-align: center;
`;

type Props = {
value: boolean,
setValue: boolean => any,
Expand All @@ -20,6 +25,8 @@ export default class PreferenceInput extends React.PureComponent {

render() {
const { value } = this.props;
return <Input type="number" value={value} onChange={this.handleChange} />;
return (
<StyledInput type="number" value={value} onChange={this.handleChange} />
);
}
}
18 changes: 9 additions & 9 deletions src/app/components/Switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ const Container = styled.div`
position: relative;
background-color: ${getColor};
width: ${({ small }) => (small ? 3 : 3.5)}rem;
color: rgba(0,0,0,0.5);
border: 1px solid rgba(0,0,0,.1);
color: rgba(0, 0, 0, 0.5);
border: 1px solid rgba(0, 0, 0, .1);
padding: 0.5rem;
height: ${props => (props.small ? 20 : 26)}px;
box-sizing: border-box;
cursor: pointer;
border-radius: 4px;

&:before, &:after {
&:before,
&:after {
position: absolute;
top: 50%;
margin-top: -.5em;
Expand All @@ -29,7 +30,7 @@ const Container = styled.div`
`;

const getSize = ({ small }) =>
(small ? 'calc(1.5rem + 2px)' : 'calc(2rem + 2px)');
small ? 'calc(1.5rem + 2px)' : 'calc(2rem + 2px)';

const Dot = styled.div`
transition: inherit;
Expand All @@ -39,9 +40,9 @@ const Dot = styled.div`
left: 0.1rem;
border-radius: 4px;
transform: translateX(${props => (props.right ? getSize(props) : '0')});
top: ${({ small }) => (small ? `calc(0.1rem + 1px)` : `calc(0.1rem)`)};
top: 0.1rem;
background-color: white;
box-shadow: 0 0 4px rgba(0,0,0,0.2);
box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
`;

type Props = {
Expand All @@ -58,7 +59,7 @@ export default ({
secondary = false,
offMode = false,
small = false,
}: Props) => (
}: Props) =>
<Container
small={small}
secondary={secondary}
Expand All @@ -67,5 +68,4 @@ export default ({
right={right}
>
<Dot small={small} right={right} />
</Container>
);
</Container>;
8 changes: 3 additions & 5 deletions src/app/components/buttons/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const styles = css`
font-size: 1.125rem;
text-align: center;
color: ${props => getColor(props)};
font-weight: 300;
font-weight: 400;
${props => !props.disabled && `box-shadow: 0 3px 3px rgba(0, 0, 0, 0.5);`};
width: ${props => (props.block ? '100%' : 'inherit')};

Expand All @@ -55,9 +55,7 @@ const styles = css`
`;
}
return 'padding: 0.65rem 2.25rem;';
}}

user-select: none;
}} user-select: none;
text-decoration: none;

${props =>
Expand All @@ -78,7 +76,7 @@ const styles = css`
&:active {
transform: translateY(1px);
box-shadow: 0 0 0 rgba(0, 0, 0, 0.5);
}`}
}`};
`;
const LinkButton = styled(Link)`${styles}`;
const AButton = styled.a`${styles};`;
Expand Down
12 changes: 6 additions & 6 deletions src/app/components/buttons/__snapshots__/Button.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

exports[`Button renders 1`] = `
<button
className="sc-htpNat iGlKTD"
className="sc-htpNat hCsYOm"
>
Test
</button>
`;

exports[`Button renders disabled 1`] = `
<button
className="sc-htpNat fTFVBb"
className="sc-htpNat hsOzQt"
disabled={true}
>
Test
Expand All @@ -19,7 +19,7 @@ exports[`Button renders disabled 1`] = `

exports[`Button renders href 1`] = `
<a
className="sc-bwzfXH eBmlcd"
className="sc-bwzfXH djbEWS"
href="https://ivesvh.com"
>
Test
Expand All @@ -28,7 +28,7 @@ exports[`Button renders href 1`] = `

exports[`Button renders onClick 1`] = `
<button
className="sc-htpNat iGlKTD"
className="sc-htpNat hCsYOm"
onClick={[Function]}
>
Test
Expand All @@ -37,15 +37,15 @@ exports[`Button renders onClick 1`] = `

exports[`Button renders properties 1`] = `
<button
className="sc-htpNat dpXcLN"
className="sc-htpNat cGrUyB"
>
Test
</button>
`;

exports[`Button renders to 1`] = `
<a
className="sc-bdVaJa gUBIAT"
className="sc-bdVaJa dRYfIP"
href="https://ivesvh.com"
onClick={[Function]}
>
Expand Down
5 changes: 2 additions & 3 deletions src/app/components/flex/Centered.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import styled from 'styled-components';
export default styled.div`
position: relative;
display: flex;
${props => props.horizontal && 'justify-content: center;'}
${props => props.vertical && 'align-items: center;'}
flex-direction: column;
${props => props.vertical && 'justify-content: center;'} ${props =>
props.horizontal && 'align-items: center;'} flex-direction: column;
width: 100%;
`;
54 changes: 54 additions & 0 deletions src/app/components/sandbox/PrivacyStatus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React from 'react';
import styled, { css } from 'styled-components';
import Question from 'react-icons/lib/go/question';

import Unlisted from 'react-icons/lib/go/link';
import Private from 'react-icons/lib/go/lock';

import Tooltip from '../Tooltip';

const iconStyles = css`
opacity: 0.5;
margin-left: 0.5em;
margin-bottom: 0.2rem;
`;

const StyledUnlisted = styled(Unlisted)(iconStyles);
const StyledPrivate = styled(Private)(iconStyles);

const PRIVACY_MESSAGES = {
0: {
title: 'Public',
tooltip: 'Everyone can see the sandbox',
icon: null,
},
1: {
title: 'Unlisted',
tooltip: 'Only users with the url can see the sandbox',
icon: <StyledUnlisted />,
},
2: {
title: 'Private',
tooltip: 'Only you can see the sandbox',
icon: <StyledPrivate />,
},
};

const Icon = styled(Question)(iconStyles);

export default ({ privacy, asIcon }: { privacy: number, asIcon: boolean }) => {
if (asIcon) {
return (
<Tooltip title={PRIVACY_MESSAGES[privacy].tooltip}>
{PRIVACY_MESSAGES[privacy].icon}
</Tooltip>
);
}

return (
<Tooltip title={PRIVACY_MESSAGES[privacy].tooltip}>
{PRIVACY_MESSAGES[privacy].title}
<Icon />
</Tooltip>
);
};
2 changes: 2 additions & 0 deletions src/app/components/sandbox/SandboxList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import styled from 'styled-components';
import moment from 'moment';
import { Link } from 'react-router-dom';

import PrivacyStatus from 'app/components/sandbox/PrivacyStatus';
import delayEffect from 'app/utils/animation/delay-effect';
import { sandboxUrl } from 'app/utils/url-generator';

Expand Down Expand Up @@ -97,6 +98,7 @@ export default ({ sandboxes, isCurrentUser, onDelete }: Props) =>
<Link to={sandboxUrl(s)}>
{s.title || s.id}
</Link>
<PrivacyStatus privacy={s.privacy} asIcon />
</td>
<td>
{moment(s.insertedAt).format('ll')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import CrossIcon from 'react-icons/lib/md/clear';
const Container = styled.span`
position: relative;
color: white;
font-size: .875rem;
background-color: ${props => props.theme.secondary};
padding: .3em .5em;
border-radius: 4px;
font-weight: 400;
font-weight: 500;

${props => props.canRemove && css`padding-right: 1.5rem;`};
`;
Expand Down
28 changes: 28 additions & 0 deletions src/app/components/sandbox/Tags/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* @flow */
import React from 'react';
import styled from 'styled-components';

import Margin from 'app/components/spacing/Margin';

import Tag from './Tag';

const TagContainer = styled.div`
margin: .75em;
display: flex;
flex-direction: row;
flex-wrap: wrap;
`;

type Props = {
tags: Array<string>,
removeTag: ?(id: string, tag: string) => void,
};

export default ({ tags, removeTag }: Props) =>
<TagContainer>
{tags.sort().map(tag =>
<Margin key={tag} vertical={0.5} horizontal={0.25}>
<Tag removeTag={removeTag} tag={tag} />
</Margin>,
)}
</TagContainer>;
21 changes: 21 additions & 0 deletions src/app/components/user/PatronStar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import styled from 'styled-components';
import moment from 'moment';
import Tooltip from 'app/components/Tooltip';
import StarIcon from 'react-icons/lib/go/star';

const Container = styled(Tooltip)`
margin-left: 0.25rem;
`;

export default ({
subscriptionSince,
...props
}: {
subscriptionSince: string,
}) =>
<Container
title={`Patron since ${moment(subscriptionSince).format('MMM/YY')}!`}
>
<StarIcon {...props} />
</Container>;
Loading