From cd4e679db79c37d4a2712de1064f952a3ce83585 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Mon, 17 Dec 2018 11:58:37 -0800 Subject: apply prettier --- .../ts/@next/components/newsletter_form.tsx | 59 +++++++++++++++++----- 1 file changed, 45 insertions(+), 14 deletions(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/@next/components/newsletter_form.tsx b/packages/website/ts/@next/components/newsletter_form.tsx index 6dc4bf678..f7cc43964 100644 --- a/packages/website/ts/@next/components/newsletter_form.tsx +++ b/packages/website/ts/@next/components/newsletter_form.tsx @@ -3,7 +3,7 @@ import styled, { withTheme } from 'styled-components'; import { colors } from 'ts/style/colors'; -import {ThemeValuesInterface} from 'ts/@next/components/siteWrap'; +import { ThemeValuesInterface } from 'ts/@next/components/siteWrap'; interface FormProps { theme: ThemeValuesInterface; @@ -27,7 +27,9 @@ const Input = React.forwardRef((props: InputProps, ref: React.Ref - + ); @@ -39,17 +41,34 @@ class Form extends React.Component { isSubmitted: false, }; public render(): React.ReactNode { - const {isSubmitted} = this.state; - const {theme} = this.props; + const { isSubmitted } = this.state; + const { theme } = this.props; return ( - + - - + + 🎉 Thank you for signing up! @@ -77,7 +96,7 @@ class Form extends React.Component { body: JSON.stringify({ email, referrer }), }); } catch (e) { - // dosomething + // dosomething } } } @@ -92,7 +111,10 @@ const StyledForm = styled.form` margin-top: 27px; `; -const StyledInput = styled.input` +const StyledInput = + styled.input < + InputProps > + ` appearance: none; background-color: transparent; border: 0; @@ -112,7 +134,10 @@ const InputWrapper = styled.div` position: relative; `; -const InnerInputWrapper = styled.div` +const InnerInputWrapper = + styled.div < + ArrowProps > + ` opacity: ${props => props.isSubmitted && 0}; visibility: ${props => props.isSubmitted && 'hidden'}; transition: opacity 0.25s ease-in-out, visibility 0.25s ease-in-out; @@ -143,7 +168,10 @@ const Text = styled.p` margin-top: 15px; `; -const SuccessText = styled.p` +const SuccessText = + styled.p < + ArrowProps > + ` color: #B1B1B1; font-size: 1rem; font-weight: 300; @@ -154,13 +182,16 @@ const SuccessText = styled.p` top: 0; text-align: left; right: 50px; - opacity: ${props => props.isSubmitted ? 1 : 0}; - visibility: ${props => props.isSubmitted ? 'visible' : 'hidden'}; + opacity: ${props => (props.isSubmitted ? 1 : 0)}; + visibility: ${props => (props.isSubmitted ? 'visible' : 'hidden')}; transition: opacity 0.25s ease-in-out, visibility 0.25s ease-in-out; transition-delay: 0.55s; `; -const Arrow = styled.svg` +const Arrow = + styled.svg < + ArrowProps > + ` transform: ${props => props.isSubmitted && `translateX(44px)`}; transition: transform 0.25s ease-in-out; `; -- cgit v1.2.3 From 2cc03216bd3642c9101c19f309895f0d3b13e82e Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Mon, 17 Dec 2018 12:00:15 -0800 Subject: manually trigger error and also send in newsletter errors --- packages/website/ts/@next/components/newsletter_form.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/@next/components/newsletter_form.tsx b/packages/website/ts/@next/components/newsletter_form.tsx index f7cc43964..eef496982 100644 --- a/packages/website/ts/@next/components/newsletter_form.tsx +++ b/packages/website/ts/@next/components/newsletter_form.tsx @@ -1,9 +1,9 @@ import * as React from 'react'; import styled, { withTheme } from 'styled-components'; -import { colors } from 'ts/style/colors'; - import { ThemeValuesInterface } from 'ts/@next/components/siteWrap'; +import { colors } from 'ts/style/colors'; +import { errorReporter } from 'ts/utils/error_reporter'; interface FormProps { theme: ThemeValuesInterface; @@ -86,6 +86,10 @@ class Form extends React.Component { this.setState({ isSubmitted: true }); + if (email === 'triggererror@0xproject.org') { + throw new Error('Manually triggered error'); + } + try { const response = await fetch('https://website-api.0x.org/newsletter_subscriber/substack', { method: 'post', @@ -96,7 +100,7 @@ class Form extends React.Component { body: JSON.stringify({ email, referrer }), }); } catch (e) { - // dosomething + errorReporter.report(e); } } } -- cgit v1.2.3 From f7581d60da832440a78a76502cbf0c4f2306906b Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Mon, 17 Dec 2018 12:21:03 -0800 Subject: fix(website): fix mis-replaced website api backend links --- packages/website/ts/utils/configs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts index 7cc854ca0..663f90249 100644 --- a/packages/website/ts/utils/configs.ts +++ b/packages/website/ts/utils/configs.ts @@ -5,8 +5,8 @@ const INFURA_API_KEY = 'T5WSC8cautR4KXyYgsRs'; export const configs = { AMOUNT_DISPLAY_PRECSION: 5, - BACKEND_BASE_PROD_URL: 'https://website-api.0x.org', - BACKEND_BASE_STAGING_URL: 'https://staging-website-api.0x.org', + BACKEND_BASE_PROD_URL: 'https://website-api.0xproject.com', + BACKEND_BASE_STAGING_URL: 'https://staging-website-api.0xproject.com', BASE_URL, BITLY_ACCESS_TOKEN: 'ffc4c1a31e5143848fb7c523b39f91b9b213d208', DEFAULT_DERIVATION_PATH: `44'/60'/0'`, -- cgit v1.2.3 From 2a0ba501e06f946c0c82992dfa4457c84befa630 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Mon, 17 Dec 2018 11:47:51 -0800 Subject: feature(website): implement loading jobs from greenhouse in jobs page --- packages/website/ts/@next/pages/about/jobs.tsx | 248 +++++++++++++++---------- 1 file changed, 149 insertions(+), 99 deletions(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/@next/pages/about/jobs.tsx b/packages/website/ts/@next/pages/about/jobs.tsx index e4a9bb1ad..1e9d54609 100644 --- a/packages/website/ts/@next/pages/about/jobs.tsx +++ b/packages/website/ts/@next/pages/about/jobs.tsx @@ -3,9 +3,12 @@ import * as React from 'react'; import styled from 'styled-components'; import { AboutPageLayout } from 'ts/@next/components/aboutPageLayout'; -import { Link } from 'ts/@next/components/link'; import { Column, FlexWrap, Section } from 'ts/@next/components/newLayout'; import { Heading, Paragraph } from 'ts/@next/components/text'; +import { WebsiteBackendJobInfo } from 'ts/types'; +import { backendClient } from 'ts/utils/backend_client'; + +const OPEN_POSITIONS_HASH = 'positions'; interface PositionProps { title: string; @@ -17,118 +20,165 @@ interface PositionItemProps { position: PositionProps; } -const positions: PositionProps[] = [ - { - title: 'Product Designer', - location: 'San Francisco, Remote', - href: '#', - }, - { - title: 'Product Designer', - location: 'San Francisco, Remote', - href: '#', - }, - { - title: 'Product Designer', - location: 'San Francisco, Remote', - href: '#', - }, - { - title: 'Open Positition', - location: "We're always interested in talking to talented people. Send us an application if you think you're the right fit.", - href: '#', - }, -]; - -export const NextAboutJobs = () => ( - - - To create a tokenized world where all value can flow freely. - - - We are growing an ecosystem of businesses and projects by solving difficult challenges to make our technology intuitive, flexible, and accessible to all. Join us in building infrastructure upon which the exchange of all assets will take place. - - - } - linkLabel="Our mission and values" - linkUrl="/about/mission" - > -
- - - Powered by a Diverse, Global Community - - - - We're a highly technical team with varied backgrounds in engineering, science, business, finance, and research. While the Core Team is headquartered in San Francisco, there are 30+ teams building on 0x and hundreds of thousands of participants behind our efforts worldwide. We're passionate about open-source software and decentralized technology's potential to act as an equalizing force in the world. - - - - - - Map of community - - -
- -
- - Benefits - - - - -
  • Comprehensive Insurance
  • -
  • Unlimited Vacation
  • -
  • Meals and snacks provided daily
  • -
  • Flexible hours and liberal work-from-home-policy
  • -
  • Supportive of remote working
  • -
  • Transportation, phone, and wellness expense
  • -
  • Relocation assistance
  • -
  • Optional team excursions
  • -
  • Competitive salary
  • -
  • Cryptocurrency based compensation
  • -
    -
    -
    - -
    - - Current
    Openings
    -
    - - - - {_.map(positions, (position, index) => ( - - ))} - -
    -
    -); - -export const Position: React.FunctionComponent = (props: PositionItemProps) => { +const Position: React.FunctionComponent = (props: PositionItemProps) => { const { position } = props; return ( - {position.title} + + + {position.title} + + - {position.location} + + {position.location} + - Apply + + + Apply + + ); }; +export interface NextAboutJobsProps {} +interface NextAboutJobsState { + jobInfos: WebsiteBackendJobInfo[]; +} + +export class NextAboutJobs extends React.Component { + private _isUnmounted: boolean; + private static _convertJobInfoToPositionProps(jobInfo: WebsiteBackendJobInfo): PositionProps { + return { + title: jobInfo.title, + location: jobInfo.office, + href: jobInfo.url, + }; + } + constructor(props: NextAboutJobsProps) { + super(props); + this.state = { + jobInfos: [], + }; + } + + public componentWillMount(): void { + // tslint:disable-next-line:no-floating-promises + this._fetchJobInfosAsync(); + } + public componentWillUnmount(): void { + this._isUnmounted = true; + } + public render(): React.ReactNode { + const positions = this.state.jobInfos.map(jobInfo => NextAboutJobs._convertJobInfoToPositionProps(jobInfo)); + return ( + + + To create a tokenized world where all value can flow freely. + + + We are growing an ecosystem of businesses and projects by solving difficult challenges to + make our technology intuitive, flexible, and accessible to all. Join us in building + infrastructure upon which the exchange of all assets will take place. + + + } + linkLabel="Our mission and values" + linkUrl="/about/mission" + > +
    + + + Powered by a Diverse, Global Community + + + + We're a highly technical team with varied backgrounds in engineering, science, business, + finance, and research. While the Core Team is headquartered in San Francisco, there are 30+ + teams building on 0x and hundreds of thousands of participants behind our efforts worldwide. + We're passionate about open-source software and decentralized technology's potential to act + as an equalizing force in the world. + + + + + + Map of community + + +
    + +
    + + Benefits + + + + +
  • Comprehensive Insurance
  • +
  • Unlimited Vacation
  • +
  • Meals and snacks provided daily
  • +
  • Flexible hours and liberal work-from-home-policy
  • +
  • Supportive of remote working
  • +
  • Transportation, phone, and wellness expense
  • +
  • Relocation assistance
  • +
  • Optional team excursions
  • +
  • Competitive salary
  • +
  • Cryptocurrency based compensation
  • +
    +
    +
    + +
    + + + Current
    Openings +
    +
    + + + {_.map(positions, (position, index) => ( + + ))} + +
    +
    + ); + } + private async _fetchJobInfosAsync(): Promise { + try { + if (!this._isUnmounted) { + this.setState({ + jobInfos: [], + }); + } + const jobInfos = await backendClient.getJobInfosAsync(); + if (!this._isUnmounted) { + this.setState({ + jobInfos, + }); + } + } catch (error) { + if (!this._isUnmounted) { + this.setState({ + jobInfos: [], + }); + } + } + } +} + const BenefitsList = styled.ul` color: #000; font-weight: 300; @@ -173,6 +223,6 @@ const PositionWrap = styled(FlexWrap)` bottom: 0; left: 0; height: 1px; - background-color: #E3E3E3; + background-color: #e3e3e3; } `; -- cgit v1.2.3 From 9fdd6e56a72ea301d6e0bd7a836ecf23b675a6d2 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Mon, 17 Dec 2018 12:05:48 -0800 Subject: fix(website): redirect /jobs to /about/jobs --- packages/website/ts/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/index.tsx b/packages/website/ts/index.tsx index 3e3dced1a..915d28aaa 100644 --- a/packages/website/ts/index.tsx +++ b/packages/website/ts/index.tsx @@ -191,7 +191,7 @@ render( path={`${WebsiteLegacyPaths.Deployer}/:version?`} component={LazySolCompilerDocumentation} /> - + -- cgit v1.2.3 From 35cb769456d6b94c768b6ce3afd9535918aea0a1 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Mon, 17 Dec 2018 12:57:59 -0800 Subject: prettify file --- packages/website/ts/@next/pages/instant/select.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/@next/pages/instant/select.tsx b/packages/website/ts/@next/pages/instant/select.tsx index 422818f9f..1e428c9a1 100644 --- a/packages/website/ts/@next/pages/instant/select.tsx +++ b/packages/website/ts/@next/pages/instant/select.tsx @@ -20,9 +20,20 @@ export const Select: React.FunctionComponent = ({ value, id, items, - {items.map((item, index) => )} + {items.map((item, index) => ( + + ))} - + + + ); }; -- cgit v1.2.3 From d32f77ebb93a904ee33a43db9207c20c889b0d8f Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Mon, 17 Dec 2018 13:01:15 -0800 Subject: Add includeEmpty option --- .../ts/@next/pages/instant/config_generator.tsx | 32 ++++++++++++---------- packages/website/ts/@next/pages/instant/select.tsx | 15 ++++++++-- 2 files changed, 29 insertions(+), 18 deletions(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/@next/pages/instant/config_generator.tsx b/packages/website/ts/@next/pages/instant/config_generator.tsx index 4f837d7fa..a1263da58 100644 --- a/packages/website/ts/@next/pages/instant/config_generator.tsx +++ b/packages/website/ts/@next/pages/instant/config_generator.tsx @@ -64,7 +64,13 @@ export class ConfigGenerator extends React.Component - {this._renderTokenMultiSelectOrSpinner()} @@ -257,7 +263,9 @@ export class ConfigGenerator extends React.Component - {metaData.symbol.toUpperCase()} — {metaData.name} + + {metaData.symbol.toUpperCase()} — {metaData.name} + ), onClick: this._handleTokenClick.bind(this, assetData), @@ -287,18 +295,9 @@ export const ConfigGeneratorSection: React.StatelessComponent {title} - {isOptional && ( - - {' '} - Optional - - )} + {isOptional && Optional} - {actionText && ( - - {actionText} - - )} + {actionText && {actionText}} {children} @@ -319,10 +318,13 @@ interface CheckboxTextProps { isSelected?: boolean; } -const CheckboxText = styled.span` +const CheckboxText = + styled.span < + CheckboxTextProps > + ` font-size: 14px; line-height: 18px; - color: ${props => props.isSelected ? colors.brandDark : '#666666'} + color: ${props => (props.isSelected ? colors.brandDark : '#666666')} `; const OptionalAction = styled(OptionalText)` diff --git a/packages/website/ts/@next/pages/instant/select.tsx b/packages/website/ts/@next/pages/instant/select.tsx index 1e428c9a1..f5b5e60c8 100644 --- a/packages/website/ts/@next/pages/instant/select.tsx +++ b/packages/website/ts/@next/pages/instant/select.tsx @@ -12,14 +12,22 @@ interface SelectProps { id: string; items: SelectItemConfig[]; emptyText?: string; - onChange?: () => void; + onChange?: (ev: React.ChangeEvent) => void; + includeEmpty: boolean; } -export const Select: React.FunctionComponent = ({ value, id, items, emptyText, onChange }) => { +export const Select: React.FunctionComponent = ({ + value, + id, + items, + includeEmpty, + emptyText, + onChange, +}) => { return ( - + {includeEmpty && } {items.map((item, index) => (