diff options
Diffstat (limited to 'packages/website/ts/@next/components')
25 files changed, 326 insertions, 227 deletions
diff --git a/packages/website/ts/@next/components/animatedChatIcon.tsx b/packages/website/ts/@next/components/animatedChatIcon.tsx index feaa0631f..9a86e244c 100644 --- a/packages/website/ts/@next/components/animatedChatIcon.tsx +++ b/packages/website/ts/@next/components/animatedChatIcon.tsx @@ -4,28 +4,69 @@ import styled, { keyframes } from 'styled-components'; export const AnimatedChatIcon = () => ( <svg width="150" height="150" viewBox="0 0 150 150" fill="none" xmlns="http://www.w3.org/2000/svg"> <mask id="mask30" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="150" height="150"> - <circle cx="75" cy="75" r="73" fill="#00AE99" stroke="#00AE99" stroke-width="3"/> + <circle cx="75" cy="75" r="73" fill="#00AE99" stroke="#00AE99" stroke-width="3" /> </mask> <g mask="url(#mask30)"> - <circle cx="75" cy="75" r="73" stroke="#00AE99" stroke-width="3"/> + <circle cx="75" cy="75" r="73" stroke="#00AE99" stroke-width="3" /> <Rays> - <path vector-effect="non-scaling-stroke" d="M76 37H137.5" stroke="#00AE99" stroke-width="3"/> - <path vector-effect="non-scaling-stroke" d="M37 73.5L37 12M113 137.5L113 75" stroke="#00AE99" stroke-width="3"/> - <path vector-effect="non-scaling-stroke" d="M13 113H71.5" stroke="#00AE99" stroke-width="3"/> - <path vector-effect="non-scaling-stroke" d="M49.087 47.5264L92.574 4.03932" stroke="#00AE99" stroke-width="3"/> - <path vector-effect="non-scaling-stroke" d="M47.3192 100.913L3.8321 57.4259M146.314 92.4277L102.12 48.2335" stroke="#00AE99" stroke-width="3"/> - <path vector-effect="non-scaling-stroke" d="M58.2793 145.814L101.766 102.327" stroke="#00AE99" stroke-width="3"/> + <path vector-effect="non-scaling-stroke" d="M76 37H137.5" stroke="#00AE99" stroke-width="3" /> + <path + vector-effect="non-scaling-stroke" + d="M37 73.5L37 12M113 137.5L113 75" + stroke="#00AE99" + stroke-width="3" + /> + <path vector-effect="non-scaling-stroke" d="M13 113H71.5" stroke="#00AE99" stroke-width="3" /> + <path + vector-effect="non-scaling-stroke" + d="M49.087 47.5264L92.574 4.03932" + stroke="#00AE99" + stroke-width="3" + /> + <path + vector-effect="non-scaling-stroke" + d="M47.3192 100.913L3.8321 57.4259M146.314 92.4277L102.12 48.2335" + stroke="#00AE99" + stroke-width="3" + /> + <path + vector-effect="non-scaling-stroke" + d="M58.2793 145.814L101.766 102.327" + stroke="#00AE99" + stroke-width="3" + /> </Rays> <Bubble> - <path vector-effect="non-scaling-stroke" d="M113 75C113 85.3064 108.897 94.6546 102.235 101.5C98.4048 105.436 71 132.5 71 132.5V112.792C51.8933 110.793 37 94.6359 37 75C37 54.0132 54.0132 37 75 37C95.9868 37 113 54.0132 113 75Z" stroke="#00AE99" strokeWidth="3"/> + <path + vector-effect="non-scaling-stroke" + d="M113 75C113 85.3064 108.897 94.6546 102.235 101.5C98.4048 105.436 71 132.5 71 132.5V112.792C51.8933 110.793 37 94.6359 37 75C37 54.0132 54.0132 37 75 37C95.9868 37 113 54.0132 113 75Z" + stroke="#00AE99" + strokeWidth="3" + /> </Bubble> - <Dot delay={0} vector-effect="non-scaling-stroke" cx="75" cy="75" r="4" stroke="#00AE99" strokeWidth="3"/> - <Dot delay={4.4} vector-effect="non-scaling-stroke" cx="91" cy="75" r="4" stroke="#00AE99" strokeWidth="3"/> - <Dot delay={-4.6} vector-effect="non-scaling-stroke" cx="59" cy="75" r="4" stroke="#00AE99" strokeWidth="3"/> + <Dot delay={0} vector-effect="non-scaling-stroke" cx="75" cy="75" r="4" stroke="#00AE99" strokeWidth="3" /> + <Dot + delay={4.4} + vector-effect="non-scaling-stroke" + cx="91" + cy="75" + r="4" + stroke="#00AE99" + strokeWidth="3" + /> + <Dot + delay={-4.6} + vector-effect="non-scaling-stroke" + cx="59" + cy="75" + r="4" + stroke="#00AE99" + strokeWidth="3" + /> </g> </svg> ); @@ -57,6 +98,9 @@ const Rays = styled.g` transform-origin: 50% 50%; `; -const Dot = styled.circle<{ delay: number }>` +const Dot = + styled.circle < + { delay: number } > + ` animation: ${fadeInOut} 4s ${props => `${props.delay}s`} infinite; `; diff --git a/packages/website/ts/@next/components/animatedCompassIcon.tsx b/packages/website/ts/@next/components/animatedCompassIcon.tsx index aa0cfd099..5388f95ca 100644 --- a/packages/website/ts/@next/components/animatedCompassIcon.tsx +++ b/packages/website/ts/@next/components/animatedCompassIcon.tsx @@ -4,17 +4,21 @@ import styled, { keyframes } from 'styled-components'; export const AnimatedCompassIcon = () => ( <svg width="150" height="150" viewBox="0 0 150 150" fill="none" xmlns="http://www.w3.org/2000/svg"> <g> - <circle cx="75" cy="75" r="73" stroke="#00AE99" stroke-width="3"/> - <circle cx="75" cy="75" r="58" stroke="#00AE99" stroke-width="3"/> - <Needle d="M62.9792 62.9792L36.6447 113.355L87.0208 87.0208M62.9792 62.9792L113.355 36.6447L87.0208 87.0208M62.9792 62.9792L87.0208 87.0208" stroke="#00AE99" strokeWidth="3"/> + <circle cx="75" cy="75" r="73" stroke="#00AE99" stroke-width="3" /> + <circle cx="75" cy="75" r="58" stroke="#00AE99" stroke-width="3" /> + <Needle + d="M62.9792 62.9792L36.6447 113.355L87.0208 87.0208M62.9792 62.9792L113.355 36.6447L87.0208 87.0208M62.9792 62.9792L87.0208 87.0208" + stroke="#00AE99" + strokeWidth="3" + /> <Dial> - <path d="M75 2V17M75 133V148" stroke="#00AE99" stroke-width="3"/> - <path d="M2 75L17 75M133 75L148 75" stroke="#00AE99" stroke-width="3"/> - <path d="M11.7801 38.5L24.7705 46M125.229 104L138.22 111.5" stroke="#00AE99" stroke-width="3"/> - <path d="M38.5001 11.7801L46.0001 24.7705M104 125.229L111.5 138.22" stroke="#00AE99" stroke-width="3"/> - <path d="M111.5 11.7801L104 24.7705M46 125.229L38.5 138.22" stroke="#00AE99" stroke-width="3"/> - <path d="M138.22 38.5L125.229 46M24.7705 104L11.7801 111.5" stroke="#00AE99" stroke-width="3"/> + <path d="M75 2V17M75 133V148" stroke="#00AE99" stroke-width="3" /> + <path d="M2 75L17 75M133 75L148 75" stroke="#00AE99" stroke-width="3" /> + <path d="M11.7801 38.5L24.7705 46M125.229 104L138.22 111.5" stroke="#00AE99" stroke-width="3" /> + <path d="M38.5001 11.7801L46.0001 24.7705M104 125.229L111.5 138.22" stroke="#00AE99" stroke-width="3" /> + <path d="M111.5 11.7801L104 24.7705M46 125.229L38.5 138.22" stroke="#00AE99" stroke-width="3" /> + <path d="M138.22 38.5L125.229 46M24.7705 104L11.7801 111.5" stroke="#00AE99" stroke-width="3" /> </Dial> </g> </svg> diff --git a/packages/website/ts/@next/components/blockIconLink.tsx b/packages/website/ts/@next/components/blockIconLink.tsx index 46a267889..bdcc5c29d 100644 --- a/packages/website/ts/@next/components/blockIconLink.tsx +++ b/packages/website/ts/@next/components/blockIconLink.tsx @@ -1,9 +1,9 @@ import * as React from 'react'; -import {withRouter} from 'react-router-dom'; +import { withRouter } from 'react-router-dom'; import styled from 'styled-components'; -import {Button} from 'ts/@next/components/button'; -import {Icon} from 'ts/@next/components/icon'; +import { Button } from 'ts/@next/components/button'; +import { Icon } from 'ts/@next/components/icon'; interface Props { icon?: string; @@ -16,48 +16,26 @@ interface Props { class BaseComponent extends React.PureComponent<Props> { public onClick = (): void => { - const { - linkAction, - linkUrl, - } = this.props; + const { linkAction, linkUrl } = this.props; if (linkAction) { linkAction(); } else { this.props.history.push(linkUrl); } - } + }; public render(): React.ReactNode { - const { - icon, - iconComponent, - linkUrl, - linkAction, - title, - linkLabel, - } = this.props; + const { icon, iconComponent, linkUrl, linkAction, title, linkLabel } = this.props; return ( <Wrap onClick={this.onClick}> <div> - <Icon - name={icon} - component={iconComponent} - size="large" - margin={[0, 0, 'default', 0]} - /> + <Icon name={icon} component={iconComponent} size="large" margin={[0, 0, 'default', 0]} /> - <Title> - {title} - </Title> + <Title>{title}</Title> - <Button - isWithArrow={true} - isTransparent={true} - href={linkUrl} - onClick={linkAction} - > + <Button isWithArrow={true} isTransparent={true} href={linkUrl} onClick={linkAction}> {linkLabel} </Button> </div> diff --git a/packages/website/ts/@next/components/button.tsx b/packages/website/ts/@next/components/button.tsx index fdf396ef0..baca01a14 100644 --- a/packages/website/ts/@next/components/button.tsx +++ b/packages/website/ts/@next/components/button.tsx @@ -23,14 +23,14 @@ interface ButtonInterface { to?: string; onClick?: () => any; theme?: ThemeInterface; - useAnchorTag?: boolean; + shouldUseAnchorTag?: boolean; } export const Button = (props: ButtonInterface) => { - const { children, href, isWithArrow, to, useAnchorTag, target } = props; + const { children, href, isWithArrow, to, shouldUseAnchorTag, target } = props; let linkElem; - if (href || useAnchorTag) { + if (href || shouldUseAnchorTag) { linkElem = 'a'; } if (to) { diff --git a/packages/website/ts/@next/components/definition.tsx b/packages/website/ts/@next/components/definition.tsx index 965466f60..8adef8d54 100644 --- a/packages/website/ts/@next/components/definition.tsx +++ b/packages/website/ts/@next/components/definition.tsx @@ -9,7 +9,7 @@ interface Action { label: string; url?: string; onClick?: () => void; - useAnchorTag?: boolean; + shouldUseAnchorTag?: boolean; } interface Props { @@ -41,7 +41,9 @@ export const Definition = (props: Props) => ( </Heading> {typeof props.description === 'string' ? ( - <Paragraph isMuted={true} size={props.fontSize || 'default'}>{props.description}</Paragraph> + <Paragraph isMuted={true} size={props.fontSize || 'default'}> + {props.description} + </Paragraph> ) : ( <>{props.description}</> )} @@ -55,7 +57,7 @@ export const Definition = (props: Props) => ( onClick={item.onClick} isWithArrow={true} isAccentColor={true} - useAnchorTag={item.useAnchorTag} + shouldUseAnchorTag={item.shouldUseAnchorTag} target="_blank" > {item.label} diff --git a/packages/website/ts/@next/components/footer.tsx b/packages/website/ts/@next/components/footer.tsx index fedae5a1b..b30a0cc5e 100644 --- a/packages/website/ts/@next/components/footer.tsx +++ b/packages/website/ts/@next/components/footer.tsx @@ -2,7 +2,6 @@ import { Link as SmartLink } from '@0x/react-shared'; import * as _ from 'lodash'; import * as React from 'react'; import MediaQuery from 'react-responsive'; -import { Link as ReactRouterLink } from 'react-router-dom'; import styled from 'styled-components'; import { Logo } from 'ts/@next/components/logo'; diff --git a/packages/website/ts/@next/components/hamburger.tsx b/packages/website/ts/@next/components/hamburger.tsx index b5c01a2b0..435d206cd 100644 --- a/packages/website/ts/@next/components/hamburger.tsx +++ b/packages/website/ts/@next/components/hamburger.tsx @@ -16,7 +16,10 @@ export const Hamburger: React.FunctionComponent<Props> = (props: Props) => { ); }; -const StyledHamburger = styled.button<Props>` +const StyledHamburger = + styled.button < + Props > + ` background: none; border: 0; width: 22px; @@ -50,7 +53,9 @@ const StyledHamburger = styled.button<Props>` //transform-origin: 0% 100%; } - ${props => props.isOpen && ` + ${props => + props.isOpen && + ` opacity: 1; transform: rotate(45deg) translate(0, 1px); diff --git a/packages/website/ts/@next/components/hero.tsx b/packages/website/ts/@next/components/hero.tsx index c79e2a6eb..4c8874d3e 100644 --- a/packages/website/ts/@next/components/hero.tsx +++ b/packages/website/ts/@next/components/hero.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import styled from 'styled-components'; -import {addFadeInAnimation} from 'ts/@next/constants/animations'; +import { addFadeInAnimation } from 'ts/@next/constants/animations'; interface Props { title: string; @@ -15,38 +15,6 @@ interface Props { actions?: React.ReactNode; } -export const Hero = (props: Props) => ( - <Section> - <Wrap isCentered={!props.figure} isFullWidth={props.isFullWidth} isCenteredMobile={props.isCenteredMobile}> - {props.figure && - <Content width="400px"> - {props.figure} - </Content> - } - - <Content width={props.maxWidth ? props.maxWidth : (props.figure ? '546px' : '678px')}> - <Title isLarge={props.isLargeTitle} maxWidth={props.maxWidthHeading}> - {props.title} - </Title> - - <Description> - {props.description} - </Description> - - {props.actions && - <ButtonWrap> - {props.actions} - </ButtonWrap> - } - </Content> - </Wrap> - </Section> -); - -Hero.defaultProps = { - isCenteredMobile: true, -}; - const Section = styled.section` padding: 120px 0; @@ -55,26 +23,41 @@ const Section = styled.section` } `; -const Wrap = styled.div<{ isCentered?: boolean; isFullWidth?: boolean; isCenteredMobile?: boolean }>` +interface WrapProps { + isCentered?: boolean; + isFullWidth?: boolean; + isCenteredMobile?: boolean; +} +const Wrap = + styled.div < + WrapProps > + ` width: calc(100% - 60px); margin: 0 auto; @media (min-width: 768px) { - max-width: ${props => !props.isFullWidth ? '895px' : '1136px'}; + max-width: ${props => (!props.isFullWidth ? '895px' : '1136px')}; flex-direction: row-reverse; display: flex; align-items: center; text-align: ${props => props.isCentered && 'center'}; - justify-content: ${props => props.isCentered ? 'center' : 'space-between'}; + justify-content: ${props => (props.isCentered ? 'center' : 'space-between')}; } @media (max-width: 768px) { - text-align: ${props => props.isCenteredMobile ? `center` : 'left'}; + text-align: ${props => (props.isCenteredMobile ? `center` : 'left')}; } `; -const Title = styled.h1<{ isLarge?: any; maxWidth?: string }>` - font-size: ${props => props.isLarge ? '80px' : '50px'}; +interface TitleProps { + isLarge?: any; + maxWidth?: string; +} +const Title = + styled.h1 < + TitleProps > + ` + font-size: ${props => (props.isLarge ? '80px' : '50px')}; font-weight: 300; line-height: 1.1; margin-left: auto; @@ -99,14 +82,15 @@ const Description = styled.p` padding: 0; margin-bottom: 50px; color: ${props => props.theme.introTextColor}; - ${addFadeInAnimation('0.5s', '0.15s')} - - @media (max-width: 1024px) { + ${addFadeInAnimation('0.5s', '0.15s')} @media (max-width: 1024px) { margin-bottom: 30px; } `; -const Content = styled.div<{ width: string }>` +const Content = + styled.div < + { width: string } > + ` width: 100%; @media (min-width: 768px) { @@ -123,10 +107,10 @@ const ButtonWrap = styled.div` } > *:nth-child(1) { - ${addFadeInAnimation('0.6s', '0.3s')} + ${addFadeInAnimation('0.6s', '0.3s')}; } > *:nth-child(2) { - ${addFadeInAnimation('0.6s', '0.4s')} + ${addFadeInAnimation('0.6s', '0.4s')}; } @media (max-width: 500px) { @@ -144,3 +128,25 @@ const ButtonWrap = styled.div` } } `; + +export const Hero: React.StatelessComponent<Props> = (props: Props) => ( + <Section> + <Wrap isCentered={!props.figure} isFullWidth={props.isFullWidth} isCenteredMobile={props.isCenteredMobile}> + {props.figure && <Content width="400px">{props.figure}</Content>} + + <Content width={props.maxWidth ? props.maxWidth : props.figure ? '546px' : '678px'}> + <Title isLarge={props.isLargeTitle} maxWidth={props.maxWidthHeading}> + {props.title} + </Title> + + <Description>{props.description}</Description> + + {props.actions && <ButtonWrap>{props.actions}</ButtonWrap>} + </Content> + </Wrap> + </Section> +); + +Hero.defaultProps = { + isCenteredMobile: true, +}; diff --git a/packages/website/ts/@next/components/heroAnimation.tsx b/packages/website/ts/@next/components/heroAnimation.tsx index 32117c1f8..42956fb6a 100644 --- a/packages/website/ts/@next/components/heroAnimation.tsx +++ b/packages/website/ts/@next/components/heroAnimation.tsx @@ -4,16 +4,49 @@ import styled, { keyframes } from 'styled-components'; export const HeroAnimation = () => ( <Image width="404" height="404" viewBox="0 0 404 404" fill="none" xmlns="http://www.w3.org/2000/svg"> <mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="404" height="404"> - <circle cx="202" cy="202" r="200" fill="#00AE99" stroke="#00AE99" stroke-width="3"/> + <circle cx="202" cy="202" r="200" fill="#00AE99" stroke="#00AE99" stroke-width="3" /> </mask> <g mask="url(#mask0)"> <circle cx="202" cy="202" r="200" stroke="#00AE99" strokeWidth="3" /> - <TopCircle vector-effect="non-scaling-stroke" cx="201.667" cy="68.6667" r="66.6667" stroke="#00AE99" strokeWidth="3"/> - <LeftCircle vector-effect="non-scaling-stroke" cx="68.6667" cy="202.667" r="66.6667" stroke="#00AE99" strokeWidth="3"/> - <Logo vector-effect="non-scaling-stroke" d="M168.17 260.29L167.271 259.089L165.46 260.444L167.413 261.585L168.17 260.29ZM197.32 269.2L197.219 270.696L197.226 270.697L197.32 269.2ZM237.414 258.856L238.22 260.12L238.225 260.117L237.414 258.856ZM252.653 245.439L253.801 246.405L254.55 245.515L253.874 244.568L252.653 245.439ZM241.096 229.872L242.285 228.958L242.281 228.952L242.276 228.946L241.096 229.872ZM237.72 225.571L238.901 224.645L237.582 222.965L236.449 224.775L237.72 225.571ZM219.719 241.445L218.672 242.519L219.418 243.246L220.36 242.801L219.719 241.445ZM208.264 230.282L209.311 229.207L208.392 228.312L207.365 229.081L208.264 230.282ZM143.827 169.549L145.02 168.64L143.647 166.838L142.524 168.806L143.827 169.549ZM135.133 198.43L133.637 198.329L133.636 198.337L135.133 198.43ZM145.464 238.577L144.201 239.388L145.464 238.577ZM158.862 253.837L157.895 254.984L158.786 255.736L159.735 255.057L158.862 253.837ZM174.409 242.264L175.324 243.453L175.33 243.448L175.336 243.443L174.409 242.264ZM178.705 238.885L179.632 240.064L181.287 238.761L179.516 237.623L178.705 238.885ZM162.851 220.757L161.78 219.707L161.049 220.452L161.495 221.397L162.851 220.757ZM174.102 209.286L175.173 210.337L176.082 209.41L175.295 208.377L174.102 209.286ZM235.163 145.072L236.036 146.292L237.92 144.945L235.92 143.777L235.163 145.072ZM206.014 136.162L205.91 137.658L205.913 137.658L206.014 136.162ZM165.817 146.506L166.629 147.767L166.632 147.765L165.817 146.506ZM150.578 159.922L149.43 158.956L148.681 159.846L149.357 160.793L150.578 159.922ZM162.135 175.489L160.946 176.403L160.951 176.409L160.955 176.415L162.135 175.489ZM165.511 179.791L164.331 180.717L165.634 182.378L166.773 180.6L165.511 179.791ZM183.614 163.916L184.655 162.836L183.913 162.122L182.98 162.557L183.614 163.916ZM194.354 174.26L193.313 175.341L194.212 176.206L195.226 175.48L194.354 174.26ZM259.608 235.505L258.411 236.409L259.789 238.233L260.914 236.243L259.608 235.505ZM268.2 206.931L269.696 207.033L269.697 207.024L268.2 206.931ZM257.87 166.784L259.135 165.979L259.132 165.974L257.87 166.784ZM244.471 151.524L245.439 150.378L244.547 149.625L243.598 150.304L244.471 151.524ZM228.924 163.097L228.009 161.909L228.003 161.913L227.997 161.918L228.924 163.097ZM224.629 166.477L223.701 165.298L222.034 166.609L223.826 167.744L224.629 166.477ZM240.584 184.604L239.228 185.244L239.235 185.259L239.242 185.274L240.584 184.604ZM240.687 184.809L241.767 185.849L242.502 185.086L242.029 184.139L240.687 184.809ZM229.845 196.075L228.764 195.035L227.877 195.957L228.648 196.979L229.845 196.075ZM167.413 261.585C176.201 266.718 186.346 269.964 197.219 270.696L197.421 267.703C187.019 267.002 177.321 263.898 168.926 258.994L167.413 261.585ZM197.226 270.697C212.283 271.639 226.405 267.659 238.22 260.12L236.607 257.591C225.307 264.8 211.813 268.604 197.413 267.703L197.226 270.697ZM238.225 260.117C244.08 256.348 249.307 251.742 253.801 246.405L251.506 244.473C247.204 249.583 242.203 253.989 236.602 257.594L238.225 260.117ZM253.874 244.568C250.283 239.533 246.385 234.295 242.285 228.958L239.906 230.786C243.989 236.1 247.864 241.309 251.432 246.31L253.874 244.568ZM242.276 228.946C241.713 228.229 241.151 227.512 240.588 226.795C240.026 226.078 239.463 225.362 238.901 224.645L236.54 226.497C237.103 227.213 237.665 227.93 238.228 228.647C238.791 229.364 239.353 230.081 239.916 230.798L242.276 228.946ZM236.449 224.775C232.311 231.384 226.193 236.725 219.078 240.089L220.36 242.801C227.974 239.201 234.538 233.481 238.992 226.367L236.449 224.775ZM220.766 240.371L209.311 229.207L207.217 231.356L218.672 242.519L220.766 240.371ZM207.365 229.081L167.271 259.089L169.069 261.49L209.163 231.483L207.365 229.081ZM142.524 168.806C137.505 177.601 134.368 187.549 133.637 198.329L136.63 198.532C137.33 188.214 140.33 178.703 145.13 170.293L142.524 168.806ZM133.636 198.337C132.696 213.409 136.668 227.654 144.201 239.388L146.726 237.767C139.531 226.56 135.73 212.947 136.63 198.524L133.636 198.337ZM144.201 239.388C147.965 245.25 152.565 250.484 157.895 254.984L159.83 252.691C154.727 248.383 150.327 243.376 146.726 237.767L144.201 239.388ZM159.735 255.057C164.764 251.461 169.994 247.558 175.324 243.453L173.494 241.076C168.187 245.164 162.985 249.045 157.99 252.617L159.735 255.057ZM175.336 243.443C176.768 242.317 178.2 241.19 179.632 240.064L177.777 237.706C176.345 238.832 174.913 239.959 173.481 241.086L175.336 243.443ZM179.516 237.623C172.904 233.374 167.568 227.241 164.208 220.117L161.495 221.397C165.09 229.021 170.8 235.588 177.894 240.147L179.516 237.623ZM163.922 221.807L175.173 210.337L173.031 208.236L161.78 219.707L163.922 221.807ZM175.295 208.377L145.02 168.64L142.634 170.458L172.909 210.196L175.295 208.377ZM235.92 143.777C227.132 138.643 216.987 135.398 206.114 134.665L205.913 137.658C216.315 138.359 226.012 141.463 234.407 146.367L235.92 143.777ZM206.118 134.665C191.055 133.618 176.824 137.599 165.003 145.246L166.632 147.765C177.926 140.459 191.515 136.657 205.91 137.658L206.118 134.665ZM165.006 145.244C159.151 149.013 153.924 153.619 149.43 158.956L151.725 160.888C156.027 155.779 161.028 151.372 166.629 147.767L165.006 145.244ZM149.357 160.793C152.948 165.828 156.846 171.066 160.946 176.403L163.325 174.575C159.242 169.261 155.367 164.052 151.799 159.051L149.357 160.793ZM160.955 176.415C161.518 177.132 162.08 177.849 162.643 178.566C163.205 179.283 163.768 180 164.331 180.717L166.691 178.865C166.128 178.148 165.566 177.431 165.003 176.714C164.441 175.997 163.878 175.28 163.315 174.563L160.955 176.415ZM166.773 180.6C171.021 173.973 177.044 168.635 184.248 165.276L182.98 162.557C175.251 166.161 168.796 171.885 164.248 178.981L166.773 180.6ZM182.574 164.997L193.313 175.341L195.394 173.18L184.655 162.836L182.574 164.997ZM195.226 175.48L236.036 146.292L234.291 143.852L193.481 173.04L195.226 175.48ZM260.914 236.243C265.827 227.556 268.964 217.713 269.696 207.033L266.703 206.828C266.003 217.042 263.004 226.453 258.303 234.767L260.914 236.243ZM269.697 207.024C270.638 191.949 266.663 177.81 259.135 165.979L256.604 167.589C263.804 178.904 267.603 192.417 266.703 206.837L269.697 207.024ZM259.132 165.974C255.368 160.111 250.769 154.878 245.439 150.378L243.503 152.67C248.606 156.978 253.007 161.986 256.607 167.594L259.132 165.974ZM243.598 150.304C238.57 153.901 233.339 157.803 228.009 161.909L229.84 164.285C235.147 160.197 240.349 156.316 245.344 152.744L243.598 150.304ZM227.997 161.918C227.281 162.481 226.565 163.045 225.849 163.608C225.133 164.171 224.417 164.734 223.701 165.298L225.556 167.656C226.272 167.092 226.988 166.529 227.704 165.966C228.42 165.402 229.136 164.839 229.852 164.276L227.997 161.918ZM223.826 167.744C230.535 171.992 235.869 178.121 239.228 185.244L241.941 183.964C238.345 176.339 232.632 169.769 225.431 165.209L223.826 167.744ZM239.242 185.274L239.345 185.479L242.029 184.139L241.926 183.934L239.242 185.274ZM239.606 183.769L228.764 195.035L230.926 197.115L241.767 185.849L239.606 183.769ZM228.648 196.979L258.411 236.409L260.806 234.601L231.042 195.171L228.648 196.979Z" fill="#00AE99"/> - <Rectangle vector-effect="non-scaling-stroke" d="M269 135V268.333H442V135H269Z" stroke="#00AE99" strokeWidth="3"/> - <Square vector-effect="non-scaling-stroke" d="M339.64 269.64L270 339.281L343.913 413.194L413.554 343.554L339.64 269.64Z" stroke="#00AE99" strokeWidth="3"/> - <Oblong vector-effect="non-scaling-stroke" d="M202.5 269C202.5 269 269 269 269 335.5C269 402 202.5 402 202.5 402H-6.5C-6.5 402 -77 402 -77 335.5C-77 269 -6.5 269 -6.5 269H202.5Z" stroke="#00AE99" strokeWidth="3"/> + <TopCircle + vector-effect="non-scaling-stroke" + cx="201.667" + cy="68.6667" + r="66.6667" + stroke="#00AE99" + strokeWidth="3" + /> + <LeftCircle + vector-effect="non-scaling-stroke" + cx="68.6667" + cy="202.667" + r="66.6667" + stroke="#00AE99" + strokeWidth="3" + /> + <Logo + vector-effect="non-scaling-stroke" + d="M168.17 260.29L167.271 259.089L165.46 260.444L167.413 261.585L168.17 260.29ZM197.32 269.2L197.219 270.696L197.226 270.697L197.32 269.2ZM237.414 258.856L238.22 260.12L238.225 260.117L237.414 258.856ZM252.653 245.439L253.801 246.405L254.55 245.515L253.874 244.568L252.653 245.439ZM241.096 229.872L242.285 228.958L242.281 228.952L242.276 228.946L241.096 229.872ZM237.72 225.571L238.901 224.645L237.582 222.965L236.449 224.775L237.72 225.571ZM219.719 241.445L218.672 242.519L219.418 243.246L220.36 242.801L219.719 241.445ZM208.264 230.282L209.311 229.207L208.392 228.312L207.365 229.081L208.264 230.282ZM143.827 169.549L145.02 168.64L143.647 166.838L142.524 168.806L143.827 169.549ZM135.133 198.43L133.637 198.329L133.636 198.337L135.133 198.43ZM145.464 238.577L144.201 239.388L145.464 238.577ZM158.862 253.837L157.895 254.984L158.786 255.736L159.735 255.057L158.862 253.837ZM174.409 242.264L175.324 243.453L175.33 243.448L175.336 243.443L174.409 242.264ZM178.705 238.885L179.632 240.064L181.287 238.761L179.516 237.623L178.705 238.885ZM162.851 220.757L161.78 219.707L161.049 220.452L161.495 221.397L162.851 220.757ZM174.102 209.286L175.173 210.337L176.082 209.41L175.295 208.377L174.102 209.286ZM235.163 145.072L236.036 146.292L237.92 144.945L235.92 143.777L235.163 145.072ZM206.014 136.162L205.91 137.658L205.913 137.658L206.014 136.162ZM165.817 146.506L166.629 147.767L166.632 147.765L165.817 146.506ZM150.578 159.922L149.43 158.956L148.681 159.846L149.357 160.793L150.578 159.922ZM162.135 175.489L160.946 176.403L160.951 176.409L160.955 176.415L162.135 175.489ZM165.511 179.791L164.331 180.717L165.634 182.378L166.773 180.6L165.511 179.791ZM183.614 163.916L184.655 162.836L183.913 162.122L182.98 162.557L183.614 163.916ZM194.354 174.26L193.313 175.341L194.212 176.206L195.226 175.48L194.354 174.26ZM259.608 235.505L258.411 236.409L259.789 238.233L260.914 236.243L259.608 235.505ZM268.2 206.931L269.696 207.033L269.697 207.024L268.2 206.931ZM257.87 166.784L259.135 165.979L259.132 165.974L257.87 166.784ZM244.471 151.524L245.439 150.378L244.547 149.625L243.598 150.304L244.471 151.524ZM228.924 163.097L228.009 161.909L228.003 161.913L227.997 161.918L228.924 163.097ZM224.629 166.477L223.701 165.298L222.034 166.609L223.826 167.744L224.629 166.477ZM240.584 184.604L239.228 185.244L239.235 185.259L239.242 185.274L240.584 184.604ZM240.687 184.809L241.767 185.849L242.502 185.086L242.029 184.139L240.687 184.809ZM229.845 196.075L228.764 195.035L227.877 195.957L228.648 196.979L229.845 196.075ZM167.413 261.585C176.201 266.718 186.346 269.964 197.219 270.696L197.421 267.703C187.019 267.002 177.321 263.898 168.926 258.994L167.413 261.585ZM197.226 270.697C212.283 271.639 226.405 267.659 238.22 260.12L236.607 257.591C225.307 264.8 211.813 268.604 197.413 267.703L197.226 270.697ZM238.225 260.117C244.08 256.348 249.307 251.742 253.801 246.405L251.506 244.473C247.204 249.583 242.203 253.989 236.602 257.594L238.225 260.117ZM253.874 244.568C250.283 239.533 246.385 234.295 242.285 228.958L239.906 230.786C243.989 236.1 247.864 241.309 251.432 246.31L253.874 244.568ZM242.276 228.946C241.713 228.229 241.151 227.512 240.588 226.795C240.026 226.078 239.463 225.362 238.901 224.645L236.54 226.497C237.103 227.213 237.665 227.93 238.228 228.647C238.791 229.364 239.353 230.081 239.916 230.798L242.276 228.946ZM236.449 224.775C232.311 231.384 226.193 236.725 219.078 240.089L220.36 242.801C227.974 239.201 234.538 233.481 238.992 226.367L236.449 224.775ZM220.766 240.371L209.311 229.207L207.217 231.356L218.672 242.519L220.766 240.371ZM207.365 229.081L167.271 259.089L169.069 261.49L209.163 231.483L207.365 229.081ZM142.524 168.806C137.505 177.601 134.368 187.549 133.637 198.329L136.63 198.532C137.33 188.214 140.33 178.703 145.13 170.293L142.524 168.806ZM133.636 198.337C132.696 213.409 136.668 227.654 144.201 239.388L146.726 237.767C139.531 226.56 135.73 212.947 136.63 198.524L133.636 198.337ZM144.201 239.388C147.965 245.25 152.565 250.484 157.895 254.984L159.83 252.691C154.727 248.383 150.327 243.376 146.726 237.767L144.201 239.388ZM159.735 255.057C164.764 251.461 169.994 247.558 175.324 243.453L173.494 241.076C168.187 245.164 162.985 249.045 157.99 252.617L159.735 255.057ZM175.336 243.443C176.768 242.317 178.2 241.19 179.632 240.064L177.777 237.706C176.345 238.832 174.913 239.959 173.481 241.086L175.336 243.443ZM179.516 237.623C172.904 233.374 167.568 227.241 164.208 220.117L161.495 221.397C165.09 229.021 170.8 235.588 177.894 240.147L179.516 237.623ZM163.922 221.807L175.173 210.337L173.031 208.236L161.78 219.707L163.922 221.807ZM175.295 208.377L145.02 168.64L142.634 170.458L172.909 210.196L175.295 208.377ZM235.92 143.777C227.132 138.643 216.987 135.398 206.114 134.665L205.913 137.658C216.315 138.359 226.012 141.463 234.407 146.367L235.92 143.777ZM206.118 134.665C191.055 133.618 176.824 137.599 165.003 145.246L166.632 147.765C177.926 140.459 191.515 136.657 205.91 137.658L206.118 134.665ZM165.006 145.244C159.151 149.013 153.924 153.619 149.43 158.956L151.725 160.888C156.027 155.779 161.028 151.372 166.629 147.767L165.006 145.244ZM149.357 160.793C152.948 165.828 156.846 171.066 160.946 176.403L163.325 174.575C159.242 169.261 155.367 164.052 151.799 159.051L149.357 160.793ZM160.955 176.415C161.518 177.132 162.08 177.849 162.643 178.566C163.205 179.283 163.768 180 164.331 180.717L166.691 178.865C166.128 178.148 165.566 177.431 165.003 176.714C164.441 175.997 163.878 175.28 163.315 174.563L160.955 176.415ZM166.773 180.6C171.021 173.973 177.044 168.635 184.248 165.276L182.98 162.557C175.251 166.161 168.796 171.885 164.248 178.981L166.773 180.6ZM182.574 164.997L193.313 175.341L195.394 173.18L184.655 162.836L182.574 164.997ZM195.226 175.48L236.036 146.292L234.291 143.852L193.481 173.04L195.226 175.48ZM260.914 236.243C265.827 227.556 268.964 217.713 269.696 207.033L266.703 206.828C266.003 217.042 263.004 226.453 258.303 234.767L260.914 236.243ZM269.697 207.024C270.638 191.949 266.663 177.81 259.135 165.979L256.604 167.589C263.804 178.904 267.603 192.417 266.703 206.837L269.697 207.024ZM259.132 165.974C255.368 160.111 250.769 154.878 245.439 150.378L243.503 152.67C248.606 156.978 253.007 161.986 256.607 167.594L259.132 165.974ZM243.598 150.304C238.57 153.901 233.339 157.803 228.009 161.909L229.84 164.285C235.147 160.197 240.349 156.316 245.344 152.744L243.598 150.304ZM227.997 161.918C227.281 162.481 226.565 163.045 225.849 163.608C225.133 164.171 224.417 164.734 223.701 165.298L225.556 167.656C226.272 167.092 226.988 166.529 227.704 165.966C228.42 165.402 229.136 164.839 229.852 164.276L227.997 161.918ZM223.826 167.744C230.535 171.992 235.869 178.121 239.228 185.244L241.941 183.964C238.345 176.339 232.632 169.769 225.431 165.209L223.826 167.744ZM239.242 185.274L239.345 185.479L242.029 184.139L241.926 183.934L239.242 185.274ZM239.606 183.769L228.764 195.035L230.926 197.115L241.767 185.849L239.606 183.769ZM228.648 196.979L258.411 236.409L260.806 234.601L231.042 195.171L228.648 196.979Z" + fill="#00AE99" + /> + <Rectangle + vector-effect="non-scaling-stroke" + d="M269 135V268.333H442V135H269Z" + stroke="#00AE99" + strokeWidth="3" + /> + <Square + vector-effect="non-scaling-stroke" + d="M339.64 269.64L270 339.281L343.913 413.194L413.554 343.554L339.64 269.64Z" + stroke="#00AE99" + strokeWidth="3" + /> + <Oblong + vector-effect="non-scaling-stroke" + d="M202.5 269C202.5 269 269 269 269 335.5C269 402 202.5 402 202.5 402H-6.5C-6.5 402 -77 402 -77 335.5C-77 269 -6.5 269 -6.5 269H202.5Z" + stroke="#00AE99" + strokeWidth="3" + /> </g> </Image> ); diff --git a/packages/website/ts/@next/components/heroImage.tsx b/packages/website/ts/@next/components/heroImage.tsx index 956218083..af7c055ac 100644 --- a/packages/website/ts/@next/components/heroImage.tsx +++ b/packages/website/ts/@next/components/heroImage.tsx @@ -5,11 +5,7 @@ interface Props { image: React.ReactNode; } -export const LandingAnimation = (props: Props) => ( - <Wrap> - {props.image} - </Wrap> -); +export const LandingAnimation = (props: Props) => <Wrap>{props.image}</Wrap>; const Wrap = styled.figure` display: inline-block; diff --git a/packages/website/ts/@next/components/icon.tsx b/packages/website/ts/@next/components/icon.tsx index d9632a3c7..fc9d488f9 100644 --- a/packages/website/ts/@next/components/icon.tsx +++ b/packages/website/ts/@next/components/icon.tsx @@ -2,8 +2,8 @@ import * as React from 'react'; import Loadable from 'react-loadable'; import styled from 'styled-components'; -import {Paragraph} from 'ts/@next/components/text'; -import {getCSSPadding, PaddingInterface} from 'ts/@next/constants/utilities'; +import { Paragraph } from 'ts/@next/components/text'; +import { getCSSPadding, PaddingInterface } from 'ts/@next/constants/utilities'; interface IconProps extends PaddingInterface { name?: string; @@ -14,7 +14,7 @@ interface IconProps extends PaddingInterface { export const Icon: React.FunctionComponent<IconProps> = (props: IconProps) => { if (props.name && !props.component) { const IconSVG = Loadable({ - loader: async () => import(/* webpackChunkName: "icon" */`ts/@next/icons/illustrations/${props.name}.svg`), + loader: async () => import(/* webpackChunkName: "icon" */ `ts/@next/icons/illustrations/${props.name}.svg`), loading: () => <Paragraph>Loading</Paragraph>, }); @@ -26,17 +26,16 @@ export const Icon: React.FunctionComponent<IconProps> = (props: IconProps) => { } if (props.component) { - return ( - <StyledIcon {...props}> - {props.component} - </StyledIcon> - ); + return <StyledIcon {...props}>{props.component}</StyledIcon>; } return null; }; -export const InlineIconWrap = styled.div<PaddingInterface>` +export const InlineIconWrap = + styled.div < + PaddingInterface > + ` margin: ${props => getCSSPadding(props.margin)}; display: flex; align-items: center; @@ -55,7 +54,10 @@ const _getSize = (size: string | number = 'small'): string => { return `${size}px`; }; -const StyledIcon = styled.figure<IconProps>` +const StyledIcon = + styled.figure < + IconProps > + ` width: ${props => _getSize(props.size)}; height: ${props => _getSize(props.size)}; margin: ${props => getCSSPadding(props.margin)}; diff --git a/packages/website/ts/@next/components/image.tsx b/packages/website/ts/@next/components/image.tsx index 34520b619..65b2a9705 100644 --- a/packages/website/ts/@next/components/image.tsx +++ b/packages/website/ts/@next/components/image.tsx @@ -9,11 +9,12 @@ interface Props { } const ImageClass: React.FunctionComponent<Props> = (props: Props) => { - return ( - <img {...props} /> - ); + return <img {...props} />; }; -export const Image = styled(ImageClass)<Props>` +export const Image = + styled(ImageClass) < + Props > + ` margin: ${props => props.isCentered && `0 auto`}; `; diff --git a/packages/website/ts/@next/components/layout.tsx b/packages/website/ts/@next/components/layout.tsx index 358120adc..770ee159c 100644 --- a/packages/website/ts/@next/components/layout.tsx +++ b/packages/website/ts/@next/components/layout.tsx @@ -1,5 +1,5 @@ import styled from 'styled-components'; -import {getCSSPadding, PADDING_SIZES, PaddingInterface} from 'ts/@next/constants/utilities'; +import { getCSSPadding, PADDING_SIZES, PaddingInterface } from 'ts/@next/constants/utilities'; interface WrapWidths { default: string; @@ -51,8 +51,8 @@ export interface WrapStickyInterface { const _getColumnWidth = (args: GetColWidthArgs): string => { const { span = 1, columns } = args; - const percentWidth = (span / columns) * 100; - const gutterDiff = (GUTTER * (columns - 1)) / columns; + const percentWidth = span / columns * 100; + const gutterDiff = GUTTER * (columns - 1) / columns; return `calc(${percentWidth}% - ${gutterDiff}px)`; }; @@ -87,8 +87,11 @@ export const Main = styled.main` // passing a asElement (same patter nas Heading) so we dont have to // make a const on every route to withComponent-size it. // just <Section asElement?="div/section/footer/header/whatever" /> ? -export const Section = styled.section<SectionProps>` - width: ${props => props.isFullWidth ? `calc(100% + ${GUTTER * 2}px)` : '100%'}; +export const Section = + styled.section < + SectionProps > + ` + width: ${props => (props.isFullWidth ? `calc(100% + ${GUTTER * 2}px)` : '100%')}; padding: ${props => !props.isNoPadding && (props.isPadLarge ? `${PADDING_SIZES.large}` : PADDING_SIZES.default)}; background-color: ${props => props.bgColor}; position: ${props => props.isRelative && 'relative'}; @@ -102,11 +105,15 @@ export const Section = styled.section<SectionProps>` @media (max-width: ${BREAKPOINTS.mobile}) { margin-bottom: ${props => !props.isNoMargin && `${GUTTER / 2}px`}; - padding: ${props => props.isPadLarge ? `${PADDING_SIZES.large} ${PADDING_SIZES.default}` : PADDING_SIZES.default}; + padding: ${props => + props.isPadLarge ? `${PADDING_SIZES.large} ${PADDING_SIZES.default}` : PADDING_SIZES.default}; } `; -const WrapBase = styled.div<WrapProps>` +const WrapBase = + styled.div < + WrapProps > + ` max-width: ${props => WRAPPER_WIDTHS[props.width || 'default']}; padding: ${props => props.padding && getCSSPadding(props.padding)}; background-color: ${props => props.bgColor}; @@ -130,7 +137,10 @@ export const WrapCentered = styled(WrapBase)` text-align: center; `; -export const WrapSticky = styled.div<WrapStickyInterface>` +export const WrapSticky = + styled.div < + WrapStickyInterface > + ` position: sticky; top: ${props => props.offsetTop || '60px'}; `; @@ -138,16 +148,21 @@ export const WrapSticky = styled.div<WrapStickyInterface>` export const WrapGrid = styled(WrapBase)` display: flex; flex-wrap: ${props => props.isWrapped && `wrap`}; - justify-content: ${props => props.isCentered ? `center` : 'space-between'}; + justify-content: ${props => (props.isCentered ? `center` : 'space-between')}; `; -export const Column = styled.div<ColumnProps>` +export const Column = + styled.div < + ColumnProps > + ` background-color: ${props => props.bgColor}; flex-grow: ${props => props.isFlexGrow && 1}; @media (min-width: ${BREAKPOINTS.mobile}) { - padding: ${props => !props.isNoPadding && (props.isPadLarge ? `${PADDING_SIZES.large} ${PADDING_SIZES.default}` : PADDING_SIZES.default)}; - width: ${props => props.colWidth ? COLUMN_WIDTHS[props.colWidth] : '100%'}; + padding: ${props => + !props.isNoPadding && + (props.isPadLarge ? `${PADDING_SIZES.large} ${PADDING_SIZES.default}` : PADDING_SIZES.default)}; + width: ${props => (props.colWidth ? COLUMN_WIDTHS[props.colWidth] : '100%')}; } @media (max-width: ${BREAKPOINTS.mobile}) { diff --git a/packages/website/ts/@next/components/logo.tsx b/packages/website/ts/@next/components/logo.tsx index 2423f07b5..227d48ee0 100644 --- a/packages/website/ts/@next/components/logo.tsx +++ b/packages/website/ts/@next/components/logo.tsx @@ -23,7 +23,10 @@ const StyledLogo = styled.div` } `; -const Icon = styled(LogoIcon)<LogoInterface>` +const Icon = + styled(LogoIcon) < + LogoInterface > + ` flex-shrink: 0; path { diff --git a/packages/website/ts/@next/components/modals/input.tsx b/packages/website/ts/@next/components/modals/input.tsx index d4d9206a2..d4d53402a 100644 --- a/packages/website/ts/@next/components/modals/input.tsx +++ b/packages/website/ts/@next/components/modals/input.tsx @@ -15,10 +15,6 @@ interface InputProps { isErrors?: boolean; } -interface LabelProps { - string: boolean; -} - interface ErrorProps { [key: string]: string; } @@ -47,7 +43,7 @@ Input.defaultProps = { const StyledInput = styled.input` appearance: none; background-color: #fff; - border: 1px solid #D5D5D5; + border: 1px solid #d5d5d5; color: #000; font-size: 1.294117647rem; padding: 16px 15px 14px; @@ -59,11 +55,14 @@ const StyledInput = styled.input` border-color: ${(props: InputProps) => props.isErrors && `#FD0000`}; &::placeholder { - color: #C3C3C3; + color: #c3c3c3; } `; -const InputWrapper = styled.div<InputProps>` +const InputWrapper = + styled.div < + InputProps > + ` position: relative; flex-grow: ${props => props.width === InputWidth.Full && 1}; width: ${props => props.width === InputWidth.Half && `calc(50% - 15px)`}; @@ -83,8 +82,8 @@ const Label = styled.label` `; const Error = styled.span` - color: #FD0000; - font-size: .833333333rem; + color: #fd0000; + font-size: 0.833333333rem; line-height: 1em; display: inline-block; position: absolute; diff --git a/packages/website/ts/@next/components/modals/modal_contact.tsx b/packages/website/ts/@next/components/modals/modal_contact.tsx index 69250fad1..b97baf5e7 100644 --- a/packages/website/ts/@next/components/modals/modal_contact.tsx +++ b/packages/website/ts/@next/components/modals/modal_contact.tsx @@ -161,6 +161,8 @@ export class ModalContact extends React.Component<Props> { this.setState({ ...this.state, errors: [], isSubmitting: true }); try { + // Disabling no-unbound method b/c no reason for _.isEmpty to be bound + // tslint:disable:no-unbound-method const response = await fetch('https://website-api.0xproject.com/leads', { method: 'post', mode: 'cors', @@ -185,6 +187,7 @@ export class ModalContact extends React.Component<Props> { } } private _parseErrors(errors: ErrorResponseProps[]): ErrorProps { + const initialValue: {} = {}; return _.reduce( errors, (hash: ErrorProps, error: ErrorResponseProps) => { @@ -194,7 +197,7 @@ export class ModalContact extends React.Component<Props> { return hash; }, - {}, + initialValue, ); } } diff --git a/packages/website/ts/@next/components/newLayout.tsx b/packages/website/ts/@next/components/newLayout.tsx index edb236576..28e7653c5 100644 --- a/packages/website/ts/@next/components/newLayout.tsx +++ b/packages/website/ts/@next/components/newLayout.tsx @@ -49,14 +49,15 @@ export interface ColumnProps { export const Section: React.FunctionComponent<SectionProps> = (props: SectionProps) => { return ( <SectionBase {...props}> - <Wrap {...props}> - {props.children} - </Wrap> + <Wrap {...props}>{props.children}</Wrap> </SectionBase> ); }; -export const Column = styled.div<ColumnProps>` +export const Column = + styled.div < + ColumnProps > + ` width: ${props => props.width}; max-width: ${props => props.maxWidth}; padding: ${props => props.padding}; @@ -70,7 +71,10 @@ export const Column = styled.div<ColumnProps>` } `; -export const FlexWrap = styled.div<FlexProps>` +export const FlexWrap = + styled.div < + FlexProps > + ` max-width: 1500px; margin: 0 auto; padding: ${props => props.padding}; @@ -81,12 +85,18 @@ export const FlexWrap = styled.div<FlexProps>` } `; -export const WrapSticky = styled.div<WrapProps>` +export const WrapSticky = + styled.div < + WrapProps > + ` position: sticky; top: ${props => props.offsetTop || '60px'}; `; -const SectionBase = styled.section<SectionProps>` +const SectionBase = + styled.section < + SectionProps > + ` width: ${props => !props.isFullWidth && 'calc(100% - 60px)'}; max-width: 1500px; margin: 0 auto; @@ -100,7 +110,10 @@ const SectionBase = styled.section<SectionProps>` } `; -const Wrap = styled(FlexWrap)<WrapProps>` +const Wrap = + styled(FlexWrap) < + WrapProps > + ` width: ${props => props.wrapWidth || 'calc(100% - 60px)'}; width: ${props => props.bgColor && 'calc(100% - 60px)'}; max-width: ${props => !props.isFullWidth && (props.maxWidth || '895px')}; @@ -108,10 +121,13 @@ const Wrap = styled(FlexWrap)<WrapProps>` margin: 0 auto; `; -export const WrapGrid = styled(Wrap)<WrapProps>` +export const WrapGrid = + styled(Wrap) < + WrapProps > + ` display: flex; flex-wrap: ${props => props.isWrapped && `wrap`}; - justify-content: ${props => props.isCentered ? `center` : 'space-between'}; + justify-content: ${props => (props.isCentered ? `center` : 'space-between')}; @media (max-width: 768px) { width: 100%; diff --git a/packages/website/ts/@next/components/newsletter_form.tsx b/packages/website/ts/@next/components/newsletter_form.tsx index eef496982..ce6b04993 100644 --- a/packages/website/ts/@next/components/newsletter_form.tsx +++ b/packages/website/ts/@next/components/newsletter_form.tsx @@ -91,7 +91,7 @@ class Form extends React.Component<FormProps> { } try { - const response = await fetch('https://website-api.0x.org/newsletter_subscriber/substack', { + await fetch('https://website-api.0x.org/newsletter_subscriber/substack', { method: 'post', mode: 'cors', headers: { diff --git a/packages/website/ts/@next/components/sections/landing/about.tsx b/packages/website/ts/@next/components/sections/landing/about.tsx index 87a0fe562..7b51b0d13 100644 --- a/packages/website/ts/@next/components/sections/landing/about.tsx +++ b/packages/website/ts/@next/components/sections/landing/about.tsx @@ -57,11 +57,11 @@ const Figure = (props: FigureProps) => ( ); const DeveloperLink = styled(Button)` - @media (max-width: 500px) { - && { - white-space: pre-wrap; - line-height: 1.3; - } + @media (max-width: 500px) { + && { + white-space: pre-wrap; + line-height: 1.3; + } } `; diff --git a/packages/website/ts/@next/components/sections/landing/clients.tsx b/packages/website/ts/@next/components/sections/landing/clients.tsx index e411feeb0..a7a526818 100644 --- a/packages/website/ts/@next/components/sections/landing/clients.tsx +++ b/packages/website/ts/@next/components/sections/landing/clients.tsx @@ -1,9 +1,9 @@ import * as _ from 'lodash'; import * as React from 'react'; import styled from 'styled-components'; -import {Heading} from 'ts/@next/components/text'; +import { Heading } from 'ts/@next/components/text'; -import {Section, WrapGrid} from 'ts/@next/components/newLayout'; +import { Section, WrapGrid } from 'ts/@next/components/newLayout'; interface ProjectLogo { name: string; @@ -58,16 +58,11 @@ const projects: ProjectLogo[] = [ export const SectionLandingClients = () => ( <Section isTextCentered={true}> - <Heading size="small"> - Join the growing number of projects developing on 0x - </Heading> + <Heading size="small">Join the growing number of projects developing on 0x</Heading> <WrapGrid isWrapped={true}> {_.map(projects, (item: ProjectLogo, index) => ( - <StyledProject - key={`client-${index}`} - isOnMobile={item.persistOnMobile} - > + <StyledProject key={`client-${index}`} isOnMobile={item.persistOnMobile}> <img src={item.imageUrl} alt={item.name} /> </StyledProject> ))} @@ -75,7 +70,10 @@ export const SectionLandingClients = () => ( </Section> ); -const StyledProject = styled.div<StyledProjectInterface>` +const StyledProject = + styled.div < + StyledProjectInterface > + ` flex-shrink: 0; img { diff --git a/packages/website/ts/@next/components/sections/landing/hero.tsx b/packages/website/ts/@next/components/sections/landing/hero.tsx index 85290d1c6..cf67ad66d 100644 --- a/packages/website/ts/@next/components/sections/landing/hero.tsx +++ b/packages/website/ts/@next/components/sections/landing/hero.tsx @@ -1,10 +1,10 @@ import * as React from 'react'; -import {Button} from 'ts/@next/components/button'; -import {Hero} from 'ts/@next/components/hero'; -import {LandingAnimation} from 'ts/@next/components/heroImage'; +import { Button } from 'ts/@next/components/button'; +import { Hero } from 'ts/@next/components/hero'; +import { LandingAnimation } from 'ts/@next/components/heroImage'; -import {HeroAnimation} from 'ts/@next/components/heroAnimation'; +import { HeroAnimation } from 'ts/@next/components/heroAnimation'; import { WebsitePaths } from 'ts/types'; export const SectionLandingHero = () => ( diff --git a/packages/website/ts/@next/components/separator.tsx b/packages/website/ts/@next/components/separator.tsx index ccc79aedf..0b8b8d766 100644 --- a/packages/website/ts/@next/components/separator.tsx +++ b/packages/website/ts/@next/components/separator.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components'; export const Separator = styled.hr` - background: #EAEAEA; + background: #eaeaea; height: 1px; border: 0; `; diff --git a/packages/website/ts/@next/components/siteWrap.tsx b/packages/website/ts/@next/components/siteWrap.tsx index db91fe08a..75cb9a268 100644 --- a/packages/website/ts/@next/components/siteWrap.tsx +++ b/packages/website/ts/@next/components/siteWrap.tsx @@ -115,13 +115,10 @@ export class SiteWrap extends React.Component<Props, State> { this.setState({ isMobileNavOpen: !this.state.isMobileNavOpen, }); - } + }; public render(): React.ReactNode { - const { - children, - theme = 'dark', - } = this.props; + const { children, theme = 'dark' } = this.props; const { isMobileNavOpen } = this.state; const currentTheme = GLOBAL_THEMES[theme]; @@ -131,16 +128,11 @@ export class SiteWrap extends React.Component<Props, State> { <> <GlobalStyles /> - <Header - isNavToggled={isMobileNavOpen} - toggleMobileNav={this.toggleMobileNav} - /> + <Header isNavToggled={isMobileNavOpen} toggleMobileNav={this.toggleMobileNav} /> - <Main isNavToggled={isMobileNavOpen}> - {children} - </Main> + <Main isNavToggled={isMobileNavOpen}>{children}</Main> - <Footer/> + <Footer /> </> </ThemeProvider> </> @@ -148,7 +140,10 @@ export class SiteWrap extends React.Component<Props, State> { } } -const Main = styled.main<MainProps>` +const Main = + styled.main < + MainProps > + ` transition: transform 0.5s, opacity 0.5s; opacity: ${props => props.isNavToggled && '0.5'}; `; diff --git a/packages/website/ts/@next/components/slider/slider.tsx b/packages/website/ts/@next/components/slider/slider.tsx index 10bbbf609..33a352b9f 100644 --- a/packages/website/ts/@next/components/slider/slider.tsx +++ b/packages/website/ts/@next/components/slider/slider.tsx @@ -7,8 +7,7 @@ import { colors } from 'ts/style/colors'; import { Icon } from 'ts/@next/components/icon'; import { Heading, Paragraph } from 'ts/@next/components/text'; -interface SliderProps { -} +interface SliderProps {} interface SlideProps { icon: string; @@ -20,7 +19,8 @@ interface SlideProps { const flickityOptions = { initialIndex: 0, cellAlign: 'left', - arrowShape: 'M0 50.766L42.467 93.58l5.791-5.839-32.346-32.61H100V46.84H15.48L50.2 11.838 44.409 6 5.794 44.93l-.003-.003z', + arrowShape: + 'M0 50.766L42.467 93.58l5.791-5.839-32.346-32.61H100V46.84H15.48L50.2 11.838 44.409 6 5.794 44.93l-.003-.003z', prevNextButtons: true, }; @@ -33,7 +33,9 @@ export const Slide: React.StatelessComponent<SlideProps> = (props: SlideProps) = <Icon name={icon} size="large" /> </SlideHead> <SlideContent> - <Heading asElement="h4" size="small" marginBottom="15px">{heading}</Heading> + <Heading asElement="h4" size="small" marginBottom="15px"> + {heading} + </Heading> <Paragraph isMuted={true}>{text}</Paragraph> </SlideContent> </StyledSlide> @@ -93,7 +95,7 @@ const StyledSlider = styled.div` top: calc(50% - 37px); border: 0; padding: 0; - transition: background-color .40s ease-in-out, visibility .40s ease-in-out, opacity .40s ease-in-out; + transition: background-color 0.4s ease-in-out, visibility 0.4s ease-in-out, opacity 0.4s ease-in-out; &:disabled { opacity: 0; @@ -130,7 +132,7 @@ const StyledSlide = styled.div` height: 520px; flex: 0 0 auto; opacity: 0.3; - transition: opacity .40s ease-in-out; + transition: opacity 0.4s ease-in-out; & + & { margin-left: 30px; diff --git a/packages/website/ts/@next/components/text.tsx b/packages/website/ts/@next/components/text.tsx index a687bca38..9f6ed9e7a 100644 --- a/packages/website/ts/@next/components/text.tsx +++ b/packages/website/ts/@next/components/text.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import styled from 'styled-components'; -import {getCSSPadding, PaddingInterface} from 'ts/@next/constants/utilities'; +import { getCSSPadding, PaddingInterface } from 'ts/@next/constants/utilities'; interface BaseTextInterface extends PaddingInterface { size?: 'default' | 'medium' | 'large' | 'small' | number; @@ -9,7 +9,7 @@ interface BaseTextInterface extends PaddingInterface { } interface HeadingProps extends BaseTextInterface { - asElement?: 'h1'| 'h2'| 'h3'| 'h4'; + asElement?: 'h1' | 'h2' | 'h3' | 'h4'; maxWidth?: string; fontWeight?: string; isCentered?: boolean; @@ -27,38 +27,33 @@ interface ParagraphProps extends BaseTextInterface { fontWeight?: string | number; } -const StyledHeading = styled.h1<HeadingProps>` +const StyledHeading = + styled.h1 < + HeadingProps > + ` max-width: ${props => props.maxWidth}; color: ${props => props.color || props.theme.textColor}; display: ${props => props.isFlex && `inline-flex`}; align-items: center; justify-content: ${props => props.isFlex && `space-between`}; - font-size: ${props => typeof props.size === 'string' ? `var(--${props.size || 'default'}Heading)` : `${props.size}px`}; + font-size: ${props => + typeof props.size === 'string' ? `var(--${props.size || 'default'}Heading)` : `${props.size}px`}; line-height: ${props => `var(--${props.size || 'default'}HeadingHeight)`}; text-align: ${props => props.isCentered && 'center'}; padding: ${props => props.padding && getCSSPadding(props.padding)}; margin-left: ${props => props.isCentered && 'auto'}; margin-right: ${props => props.isCentered && 'auto'}; margin-bottom: ${props => !props.isNoMargin && (props.marginBottom || '30px')}; - opacity: ${props => typeof props.isMuted === 'boolean' ? 0.75 : props.isMuted}; - font-weight: ${props => props.fontWeight ? props.fontWeight : (['h4'].includes(props.asElement) ? 400 : 300)}; + opacity: ${props => (typeof props.isMuted === 'boolean' ? 0.75 : props.isMuted)}; + font-weight: ${props => (props.fontWeight ? props.fontWeight : ['h4'].includes(props.asElement) ? 400 : 300)}; width: ${props => props.isFlex && `100%`}; `; export const Heading: React.StatelessComponent<HeadingProps> = props => { - const { - asElement = 'h1', - children, - } = props; + const { asElement = 'h1', children } = props; const Component = StyledHeading.withComponent(asElement); - return ( - <Component - {...props} - > - {children} - </Component> - ); + return <Component {...props}>{children}</Component>; }; Heading.defaultProps = { @@ -69,14 +64,17 @@ Heading.defaultProps = { // Note: this would be useful to be implemented the same way was "Heading" // and be more generic. e.g. <Text /> with a props asElement so we can use it // for literally anything = -export const Paragraph = styled.p<ParagraphProps>` +export const Paragraph = + styled.p < + ParagraphProps > + ` font-size: ${props => `var(--${props.size || 'default'}Paragraph)`}; font-weight: ${props => props.fontWeight || 300}; margin-bottom: ${props => !props.isNoMargin && (props.marginBottom || '30px')}; padding: ${props => props.padding && getCSSPadding(props.padding)}; color: ${props => props.color || props.theme.paragraphColor}; - opacity: ${props => typeof props.isMuted === 'boolean' ? 0.75 : props.isMuted}; - text-align: ${props => props.textAlign ? props.textAlign : props.isCentered && 'center'}; + opacity: ${props => (typeof props.isMuted === 'boolean' ? 0.75 : props.isMuted)}; + text-align: ${props => (props.textAlign ? props.textAlign : props.isCentered && 'center')}; line-height: 1.4; `; |