aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website
diff options
context:
space:
mode:
Diffstat (limited to 'packages/website')
-rw-r--r--packages/website/ts/@next/components/newsletter_form.tsx65
-rw-r--r--packages/website/ts/@next/components/sections/landing/about.tsx47
-rw-r--r--packages/website/ts/@next/pages/about/jobs.tsx248
-rw-r--r--packages/website/ts/components/onboarding/onboarding_flow.tsx4
-rw-r--r--packages/website/ts/components/ui/animation.tsx42
-rw-r--r--packages/website/ts/components/ui/ease_up_from_bottom_animation.tsx32
-rw-r--r--packages/website/ts/index.tsx2
7 files changed, 247 insertions, 193 deletions
diff --git a/packages/website/ts/@next/components/newsletter_form.tsx b/packages/website/ts/@next/components/newsletter_form.tsx
index 6dc4bf678..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 { ThemeValuesInterface } from 'ts/@next/components/siteWrap';
import { colors } from 'ts/style/colors';
-
-import {ThemeValuesInterface} from 'ts/@next/components/siteWrap';
+import { errorReporter } from 'ts/utils/error_reporter';
interface FormProps {
theme: ThemeValuesInterface;
@@ -27,7 +27,9 @@ const Input = React.forwardRef((props: InputProps, ref: React.Ref<HTMLInputEleme
return (
<InnerInputWrapper {...props}>
- <label className="visuallyHidden" htmlFor={id}>{label}</label>
+ <label className="visuallyHidden" htmlFor={id}>
+ {label}
+ </label>
<StyledInput ref={ref} id={id} placeholder={label} type={type || 'text'} {...props} />
</InnerInputWrapper>
);
@@ -39,17 +41,34 @@ class Form extends React.Component<FormProps> {
isSubmitted: false,
};
public render(): React.ReactNode {
- const {isSubmitted} = this.state;
- const {theme} = this.props;
+ const { isSubmitted } = this.state;
+ const { theme } = this.props;
return (
<StyledForm onSubmit={this._onSubmitAsync.bind(this)}>
<InputWrapper>
- <Input isSubmitted={isSubmitted} name="email" type="email" label="Email Address" ref={this.emailInput} required={true} textColor={theme.textColor} />
+ <Input
+ isSubmitted={isSubmitted}
+ name="email"
+ type="email"
+ label="Email Address"
+ ref={this.emailInput}
+ required={true}
+ textColor={theme.textColor}
+ />
<SubmitButton>
- <Arrow isSubmitted={isSubmitted} width="22" height="17" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M13.066 0l-1.068 1.147 6.232 6.557H0v1.592h18.23l-6.232 6.557L13.066 17l8.08-8.5-8.08-8.5z" fill="#CBCBCB"/>
+ <Arrow
+ isSubmitted={isSubmitted}
+ width="22"
+ height="17"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d="M13.066 0l-1.068 1.147 6.232 6.557H0v1.592h18.23l-6.232 6.557L13.066 17l8.08-8.5-8.08-8.5z"
+ fill="#CBCBCB"
+ />
</Arrow>
</SubmitButton>
<SuccessText isSubmitted={isSubmitted}>🎉 Thank you for signing up!</SuccessText>
@@ -67,6 +86,10 @@ class Form extends React.Component<FormProps> {
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',
@@ -77,7 +100,7 @@ class Form extends React.Component<FormProps> {
body: JSON.stringify({ email, referrer }),
});
} catch (e) {
- // dosomething
+ errorReporter.report(e);
}
}
}
@@ -92,7 +115,10 @@ const StyledForm = styled.form`
margin-top: 27px;
`;
-const StyledInput = styled.input<InputProps>`
+const StyledInput =
+ styled.input <
+ InputProps >
+ `
appearance: none;
background-color: transparent;
border: 0;
@@ -112,7 +138,10 @@ const InputWrapper = styled.div`
position: relative;
`;
-const InnerInputWrapper = styled.div<ArrowProps>`
+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 +172,10 @@ const Text = styled.p`
margin-top: 15px;
`;
-const SuccessText = styled.p<ArrowProps>`
+const SuccessText =
+ styled.p <
+ ArrowProps >
+ `
color: #B1B1B1;
font-size: 1rem;
font-weight: 300;
@@ -154,13 +186,16 @@ const SuccessText = styled.p<ArrowProps>`
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<ArrowProps>`
+const Arrow =
+ styled.svg <
+ ArrowProps >
+ `
transform: ${props => props.isSubmitted && `translateX(44px)`};
transition: transform 0.25s ease-in-out;
`;
diff --git a/packages/website/ts/@next/components/sections/landing/about.tsx b/packages/website/ts/@next/components/sections/landing/about.tsx
index ee1cfb434..9c2c29446 100644
--- a/packages/website/ts/@next/components/sections/landing/about.tsx
+++ b/packages/website/ts/@next/components/sections/landing/about.tsx
@@ -1,10 +1,10 @@
import * as React from 'react';
import styled from 'styled-components';
-import {Button} from 'ts/@next/components/button';
-import {Icon, InlineIconWrap} from 'ts/@next/components/icon';
-import {Column, FlexWrap, Section} from 'ts/@next/components/newLayout';
-import {Paragraph} from 'ts/@next/components/text';
+import { Button } from 'ts/@next/components/button';
+import { Icon, InlineIconWrap } from 'ts/@next/components/icon';
+import { Column, FlexWrap, Section } from 'ts/@next/components/newLayout';
+import { Paragraph } from 'ts/@next/components/text';
interface FigureProps {
value: string;
@@ -20,20 +20,12 @@ export const SectionLandingAbout = () => (
<Icon name="descriptionBolt" size="small" />
</InlineIconWrap>
- <Paragraph
- size="large"
- isCentered={true}
- isMuted={1}
- padding={['large', 0, 'default', 0]}
- >
- Anyone in the world can use 0x to service a wide variety of markets ranging from gaming items to financial instruments to assets that could have never existed before.
+ <Paragraph size="large" isCentered={true} isMuted={1} padding={['large', 0, 'default', 0]}>
+ Anyone in the world can use 0x to service a wide variety of markets ranging from gaming items to financial
+ instruments to assets that could have never existed before.
</Paragraph>
- <Button
- href="#"
- isWithArrow={true}
- isAccentColor={true}
- >
+ <Button href="#" isWithArrow={true} isAccentColor={true}>
Discover how developers use 0x
</Button>
@@ -46,32 +38,19 @@ export const SectionLandingAbout = () => (
/>
<FlexWrap as="dl">
- <Figure
- value="873,435"
- description="Number of Transactions"
- />
+ <Figure value="166,976" description="Total Transactions" />
- <Figure
- value="$203M"
- description="Total Volume"
- />
+ <Figure value="$216M" description="Total Volume" />
- <Figure
- value="227,372"
- description="Number of Relayers"
- />
+ <Figure value="30+" description="Total Projects" />
</FlexWrap>
</Section>
);
const Figure = (props: FigureProps) => (
<Column padding="0 30px">
- <FigureValue>
- {props.value}
- </FigureValue>
- <FigureDescription>
- {props.description}
- </FigureDescription>
+ <FigureValue>{props.value}</FigureValue>
+ <FigureDescription>{props.description}</FigureDescription>
</Column>
);
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 = () => (
- <AboutPageLayout
- title="Join Us in Our Mission"
- description={
- <>
- <Paragraph size="medium">
- To create a tokenized world where all value can flow freely.
- </Paragraph>
- <Paragraph size="medium">
- 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.
- </Paragraph>
- </>
- }
- linkLabel="Our mission and values"
- linkUrl="/about/mission"
- >
- <Section bgColor="#F3F6F4" isFlex={true} maxWidth="1170px" wrapWidth="100%">
- <Column maxWidth="442px">
- <Heading size="medium" marginBottom="30px">
- Powered by a Diverse, Global Community
- </Heading>
-
- <Paragraph>
- 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.
- </Paragraph>
- </Column>
-
- <Column maxWidth="600px">
- <ImageWrap>
- <img src="/images/@next/jobs/map@2x.png" height="365" alt="Map of community"/>
- </ImageWrap>
- </Column>
- </Section>
-
- <Section isFlex={true} maxWidth="1170px" wrapWidth="100%">
- <Column>
- <Heading size="medium">Benefits</Heading>
- </Column>
-
- <Column maxWidth="826px">
- <BenefitsList>
- <li>Comprehensive Insurance</li>
- <li>Unlimited Vacation</li>
- <li>Meals and snacks provided daily</li>
- <li>Flexible hours and liberal work-from-home-policy</li>
- <li>Supportive of remote working</li>
- <li>Transportation, phone, and wellness expense</li>
- <li>Relocation assistance</li>
- <li>Optional team excursions</li>
- <li>Competitive salary</li>
- <li>Cryptocurrency based compensation</li>
- </BenefitsList>
- </Column>
- </Section>
-
- <Section isFlex={true} maxWidth="1170px" wrapWidth="100%">
- <Column>
- <Heading size="medium">Current<br/>Openings</Heading>
- </Column>
-
- <Column maxWidth="826px">
-
- {_.map(positions, (position, index) => (
- <Position key={`position-${index}`} position={position} />
- ))}
- </Column>
- </Section>
- </AboutPageLayout>
-);
-
-export const Position: React.FunctionComponent<PositionItemProps> = (props: PositionItemProps) => {
+const Position: React.FunctionComponent<PositionItemProps> = (props: PositionItemProps) => {
const { position } = props;
return (
<PositionWrap>
<StyledColumn width="30%">
- <Heading asElement="h3" size="small" fontWeight="400" marginBottom="0"><a href={position.href}>{position.title}</a></Heading>
+ <Heading asElement="h3" size="small" fontWeight="400" marginBottom="0">
+ <a href={position.href} target="_blank">
+ {position.title}
+ </a>
+ </Heading>
</StyledColumn>
<StyledColumn width="50%" padding="0 40px 0 0">
- <Paragraph isMuted={true} marginBottom="0">{position.location}</Paragraph>
+ <Paragraph isMuted={true} marginBottom="0">
+ {position.location}
+ </Paragraph>
</StyledColumn>
<StyledColumn width="20%">
- <Paragraph marginBottom="0" textAlign="right"><Link href={position.href}>Apply</Link></Paragraph>
+ <Paragraph marginBottom="0" textAlign="right">
+ <a href={position.href} target="_blank">
+ Apply
+ </a>
+ </Paragraph>
</StyledColumn>
</PositionWrap>
);
};
+export interface NextAboutJobsProps {}
+interface NextAboutJobsState {
+ jobInfos: WebsiteBackendJobInfo[];
+}
+
+export class NextAboutJobs extends React.Component<NextAboutJobsProps, NextAboutJobsState> {
+ 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 (
+ <AboutPageLayout
+ title="Join Us in Our Mission"
+ description={
+ <>
+ <Paragraph size="medium">
+ To create a tokenized world where all value can flow freely.
+ </Paragraph>
+ <Paragraph size="medium">
+ 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.
+ </Paragraph>
+ </>
+ }
+ linkLabel="Our mission and values"
+ linkUrl="/about/mission"
+ >
+ <Section bgColor="#F3F6F4" isFlex={true} maxWidth="1170px" wrapWidth="100%">
+ <Column maxWidth="442px">
+ <Heading size="medium" marginBottom="30px">
+ Powered by a Diverse, Global Community
+ </Heading>
+
+ <Paragraph>
+ 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.
+ </Paragraph>
+ </Column>
+
+ <Column maxWidth="600px">
+ <ImageWrap>
+ <img src="/images/@next/jobs/map@2x.png" height="365" alt="Map of community" />
+ </ImageWrap>
+ </Column>
+ </Section>
+
+ <Section isFlex={true} maxWidth="1170px" wrapWidth="100%">
+ <Column>
+ <Heading size="medium">Benefits</Heading>
+ </Column>
+
+ <Column maxWidth="826px">
+ <BenefitsList>
+ <li>Comprehensive Insurance</li>
+ <li>Unlimited Vacation</li>
+ <li>Meals and snacks provided daily</li>
+ <li>Flexible hours and liberal work-from-home-policy</li>
+ <li>Supportive of remote working</li>
+ <li>Transportation, phone, and wellness expense</li>
+ <li>Relocation assistance</li>
+ <li>Optional team excursions</li>
+ <li>Competitive salary</li>
+ <li>Cryptocurrency based compensation</li>
+ </BenefitsList>
+ </Column>
+ </Section>
+
+ <Section id={OPEN_POSITIONS_HASH} isFlex={true} maxWidth="1170px" wrapWidth="100%">
+ <Column>
+ <Heading size="medium">
+ Current<br />Openings
+ </Heading>
+ </Column>
+
+ <Column maxWidth="826px">
+ {_.map(positions, (position, index) => (
+ <Position key={`position-${index}`} position={position} />
+ ))}
+ </Column>
+ </Section>
+ </AboutPageLayout>
+ );
+ }
+ private async _fetchJobInfosAsync(): Promise<void> {
+ 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;
}
`;
diff --git a/packages/website/ts/components/onboarding/onboarding_flow.tsx b/packages/website/ts/components/onboarding/onboarding_flow.tsx
index 91d5f2476..ec1b5bc42 100644
--- a/packages/website/ts/components/onboarding/onboarding_flow.tsx
+++ b/packages/website/ts/components/onboarding/onboarding_flow.tsx
@@ -7,8 +7,8 @@ import {
OnboardingTooltip,
TooltipPointerDisplay,
} from 'ts/components/onboarding/onboarding_tooltip';
-import { Animation } from 'ts/components/ui/animation';
import { Container } from 'ts/components/ui/container';
+import { EaseUpFromBottomAnimation } from 'ts/components/ui/ease_up_from_bottom_animation';
import { Overlay } from 'ts/components/ui/overlay';
import { zIndex } from 'ts/style/z_index';
@@ -66,7 +66,7 @@ export class OnboardingFlow extends React.Component<OnboardingFlowProps> {
let onboardingElement = null;
const currentStep = this._getCurrentStep();
if (this.props.isMobile) {
- onboardingElement = <Animation type="easeUpFromBottom">{this._renderOnboardingCard()}</Animation>;
+ onboardingElement = <EaseUpFromBottomAnimation>{this._renderOnboardingCard()}</EaseUpFromBottomAnimation>;
} else if (currentStep.position.type === 'target') {
const { placement, target } = currentStep.position;
onboardingElement = (
diff --git a/packages/website/ts/components/ui/animation.tsx b/packages/website/ts/components/ui/animation.tsx
deleted file mode 100644
index 943e3bf28..000000000
--- a/packages/website/ts/components/ui/animation.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import * as React from 'react';
-import { keyframes, styled } from 'ts/style/theme';
-
-export type AnimationType = 'easeUpFromBottom';
-
-export interface AnimationProps {
- type: AnimationType;
-}
-
-const PlainAnimation: React.StatelessComponent<AnimationProps> = props => <div {...props} />;
-
-const appearFromBottomFrames = keyframes`
- from {
- position: fixed;
- bottom: -500px;
- left: 0px;
- right: 0px;
- }
-
- to {
- position: fixed;
- bottom: 0px;
- left: 0px;
- right: 0px;
- }
-`;
-
-const stylesForAnimation: { [K in AnimationType]: string } = {
- // Needed for safari
- easeUpFromBottom: `position: fixed`,
-};
-
-const animations: { [K in AnimationType]: string } = {
- easeUpFromBottom: `${appearFromBottomFrames} 1s ease 0s 1 forwards`,
-};
-
-export const Animation = styled(PlainAnimation)`
- animation: ${props => animations[props.type]};
- ${props => stylesForAnimation[props.type]};
-`;
-
-Animation.displayName = 'Animation';
diff --git a/packages/website/ts/components/ui/ease_up_from_bottom_animation.tsx b/packages/website/ts/components/ui/ease_up_from_bottom_animation.tsx
new file mode 100644
index 000000000..176c9410c
--- /dev/null
+++ b/packages/website/ts/components/ui/ease_up_from_bottom_animation.tsx
@@ -0,0 +1,32 @@
+import * as React from 'react';
+import { css, keyframes, styled } from 'ts/style/theme';
+
+const appearFromBottomFrames = keyframes`
+ from {
+ position: fixed;
+ bottom: -500px;
+ left: 0px;
+ right: 0px;
+ }
+
+ to {
+ position: fixed;
+ bottom: 0px;
+ left: 0px;
+ right: 0px;
+ }
+`;
+
+const stylesForAnimation = css`
+ position: fixed;
+`;
+const animations = css`
+ animation: ${appearFromBottomFrames} 1s ease 0s 1 forwards;
+`;
+
+export const EaseUpFromBottomAnimation = styled.div`
+ ${props => animations};
+ ${props => stylesForAnimation};
+`;
+
+EaseUpFromBottomAnimation.displayName = 'EaseUpFromBottomAnimation';
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}
/>
- <Route path={WebsiteLegacyPaths.Jobs} component={Jobs as any} />
+ <Redirect from={WebsiteLegacyPaths.Jobs} to={WebsitePaths.AboutJobs} />
<Route component={NotFound as any} />
</Switch>
</div>