diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-06-13 07:11:31 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-06-13 07:11:31 +0800 |
commit | d0bbee7e8c3eaac1f727a9f40a2213d041938c3b (patch) | |
tree | c712540ee483188944a5e0e81b1acb257803c70a /packages/website/ts/pages | |
parent | 76405639913b28c86f8cf9db65905215288e6032 (diff) | |
download | dexon-sol-tools-d0bbee7e8c3eaac1f727a9f40a2213d041938c3b.tar.gz dexon-sol-tools-d0bbee7e8c3eaac1f727a9f40a2213d041938c3b.tar.zst dexon-sol-tools-d0bbee7e8c3eaac1f727a9f40a2213d041938c3b.zip |
Fix issue with positions hash
Diffstat (limited to 'packages/website/ts/pages')
-rw-r--r-- | packages/website/ts/pages/jobs/open_positions.tsx | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/packages/website/ts/pages/jobs/open_positions.tsx b/packages/website/ts/pages/jobs/open_positions.tsx index 79b51c0d1..f3d980315 100644 --- a/packages/website/ts/pages/jobs/open_positions.tsx +++ b/packages/website/ts/pages/jobs/open_positions.tsx @@ -44,26 +44,28 @@ export class OpenPositions extends React.Component<OpenPositionsProps, OpenPosit } public render(): React.ReactNode { const isReadyToRender = _.isUndefined(this.state.error) && !_.isUndefined(this.state.jobInfos); + return ( + <div id={this.props.hash} className="mx-auto max-width-4"> + {isReadyToRender ? this._renderBody() : this._renderLoading()} + </div> + ); + } + private _renderBody(): React.ReactNode { const isSmallScreen = this.props.screenWidth === ScreenWidths.Sm; - if (!isReadyToRender) { - return ( - // TODO: consolidate this loading component with the one in portal and RelayerIndex - // TODO: possibly refactor into a generic loading container with spinner and retry UI - <div className="center"> - {_.isUndefined(this.state.error) ? ( - <CircularProgress size={40} thickness={5} /> - ) : ( - <Retry onRetry={this._fetchJobInfosAsync.bind(this)} /> - )} - </div> - ); - } else { - return ( - <div id={this.props.hash} className="mx-auto max-width-4"> - {isSmallScreen ? this._renderList() : this._renderTable()} - </div> - ); - } + return isSmallScreen ? this._renderList() : this._renderTable(); + } + private _renderLoading(): React.ReactNode { + return ( + // TODO: consolidate this loading component with the one in portal and RelayerIndex + // TODO: possibly refactor into a generic loading container with spinner and retry UI + <div className="center"> + {_.isUndefined(this.state.error) ? ( + <CircularProgress size={40} thickness={5} /> + ) : ( + <Retry onRetry={this._fetchJobInfosAsync.bind(this)} /> + )} + </div> + ); } private _renderList(): React.ReactNode { return ( |