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/pages/jobs/open_positions.tsx | 154 ++++++++++------------ 1 file changed, 72 insertions(+), 82 deletions(-) (limited to 'packages/website/ts/pages/jobs/open_positions.tsx') 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