aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-12-18 03:47:51 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-12-18 04:21:36 +0800
commit2a0ba501e06f946c0c82992dfa4457c84befa630 (patch)
tree95f9891092b1d46ea68cb5fbceb5af380f35697e
parent90d4a2b590a9934f3464d2a41bec51ecfde684cf (diff)
downloaddexon-sol-tools-2a0ba501e06f946c0c82992dfa4457c84befa630.tar
dexon-sol-tools-2a0ba501e06f946c0c82992dfa4457c84befa630.tar.gz
dexon-sol-tools-2a0ba501e06f946c0c82992dfa4457c84befa630.tar.bz2
dexon-sol-tools-2a0ba501e06f946c0c82992dfa4457c84befa630.tar.lz
dexon-sol-tools-2a0ba501e06f946c0c82992dfa4457c84befa630.tar.xz
dexon-sol-tools-2a0ba501e06f946c0c82992dfa4457c84befa630.tar.zst
dexon-sol-tools-2a0ba501e06f946c0c82992dfa4457c84befa630.zip
feature(website): implement loading jobs from greenhouse in jobs page
-rw-r--r--packages/website/ts/@next/pages/about/jobs.tsx248
1 files changed, 149 insertions, 99 deletions
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;
}
`;