From e0fbc78925df09631045439b4f979246bc857c86 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Wed, 18 Jul 2018 10:32:42 -0700 Subject: Update open positions section --- packages/website/ts/components/ui/container.tsx | 7 +- packages/website/ts/pages/jobs/benefits.tsx | 2 +- packages/website/ts/pages/jobs/open_positions.tsx | 154 ++++++++++------------ 3 files changed, 78 insertions(+), 85 deletions(-) diff --git a/packages/website/ts/components/ui/container.tsx b/packages/website/ts/components/ui/container.tsx index 427cc6cc7..502069dee 100644 --- a/packages/website/ts/components/ui/container.tsx +++ b/packages/website/ts/components/ui/container.tsx @@ -9,6 +9,7 @@ export interface ContainerProps { marginBottom?: StringOrNum; marginRight?: StringOrNum; marginLeft?: StringOrNum; + padding?: StringOrNum; paddingTop?: StringOrNum; paddingBottom?: StringOrNum; paddingRight?: StringOrNum; @@ -31,13 +32,15 @@ export interface ContainerProps { bottom?: string; zIndex?: number; Tag?: ContainerTag; + id?: string; + onClick?: (event: React.MouseEvent) => void; } export const Container: React.StatelessComponent = props => { - const { children, className, Tag, isHidden, ...style } = props; + const { children, className, Tag, isHidden, id, onClick, ...style } = props; const visibility = isHidden ? 'hidden' : undefined; return ( - + {children} ); diff --git a/packages/website/ts/pages/jobs/benefits.tsx b/packages/website/ts/pages/jobs/benefits.tsx index c8024068f..39d2e0f2c 100644 --- a/packages/website/ts/pages/jobs/benefits.tsx +++ b/packages/website/ts/pages/jobs/benefits.tsx @@ -51,7 +51,7 @@ export const Benefits = (props: BenefitsProps) => { {!isSmallScreen ? ( - + diff --git a/packages/website/ts/pages/jobs/open_positions.tsx b/packages/website/ts/pages/jobs/open_positions.tsx index c9fe987e4..e349e30c5 100644 --- a/packages/website/ts/pages/jobs/open_positions.tsx +++ b/packages/website/ts/pages/jobs/open_positions.tsx @@ -3,6 +3,7 @@ import CircularProgress from 'material-ui/CircularProgress'; import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from 'material-ui/Table'; import * as React from 'react'; +import { Container } from 'ts/components/ui/container'; import { Retry } from 'ts/components/ui/retry'; import { Text } from 'ts/components/ui/text'; import { colors } from 'ts/style/colors'; @@ -43,16 +44,19 @@ export class OpenPositions extends React.Component - {isReadyToRender ? this._renderBody() : this._renderLoading()} - + + {!isSmallScreen &&
} + + + Open Positions + + + {isReadyToRender ? this._renderTable() : this._renderLoading()} +
); } - private _renderBody(): React.ReactNode { - const isSmallScreen = this.props.screenWidth === ScreenWidths.Sm; - return isSmallScreen ? this._renderList() : this._renderTable(); - } private _renderLoading(): React.ReactNode { return ( // TODO: consolidate this loading component with the one in portal and RelayerIndex @@ -66,64 +70,31 @@ export class OpenPositions extends React.Component ); } - private _renderList(): React.ReactNode { - return ( -
- {_.map(this.state.jobInfos, jobInfo => ( - - ))} -
- ); - } private _renderTable(): React.ReactNode { return ( -
- - - - - Position - - - Department - - - Office - - - - - {_.map(this.state.jobInfos, jobInfo => { - return this._renderJobInfoTableRow(jobInfo); - })} - -
-
+ + {_.map(this.state.jobInfos, jobInfo => { + return ( + + ); + })} + ); } private _renderJobInfoTableRow(jobInfo: WebsiteBackendJobInfo): React.ReactNode { return ( - - - {jobInfo.title} - - - {jobInfo.department} - - - {jobInfo.office} - - + + + {jobInfo.title} + {jobInfo.department} + {jobInfo.office} + + ); } private async _fetchJobInfosAsync(): Promise { @@ -135,9 +106,10 @@ export class OpenPositions extends React.Component) => void; } -const PlainJobInfoListItem: React.StatelessComponent = ({ title, description, onClick }) => ( -
- - {title + ' ›'} - - - {description} - -
-); +const PlainJobInfoTableRow: React.StatelessComponent = ({ + className, + screenWidth, + jobInfo, + onClick, +}) => { + const isSmallScreen = screenWidth === ScreenWidths.Sm; + const titleClassName = isSmallScreen ? 'col col-12 center' : 'col col-5'; + const paddingLeft = isSmallScreen ? undefined : '30px'; + return ( + + + + + + {jobInfo.title} + + + {!isSmallScreen && ( + + {jobInfo.department} + + )} + {!isSmallScreen && ( + + {jobInfo.office} + + )} + + + + ); +}; -export const JobInfoListItem = styled(PlainJobInfoListItem)` +export const JobInfoTableRow = styled(PlainJobInfoTableRow)` cursor: pointer; + background-color: ${colors.grey100}; + border-radius: 7px; &:hover { opacity: 0.5; } -- cgit v1.2.3