Skip to content

Commit

Permalink
move precincts reporting if we're not showing the loading bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Fisher committed Dec 11, 2017
1 parent 255ed24 commit 4d5f08f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ResultsMap extends React.Component {
render() {
return (
<div>
<div id="fetch-refresh-widget-component" />
<div id="fetch-refresh-widget-component" hidden={this.props.hidden} />
</div>
);
}
Expand Down
11 changes: 6 additions & 5 deletions theshow/staticapp/src/js/race-app/containers/TopResults.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@ import FetchRefresh from '../components/FetchRefresh';

const TopResults = (props) => {
const status = getStatus(props);
const loadingBar = status.tabulated || status.precinctsReportingPct === 1 ? null : (
<FetchRefresh fetch={props.fetch} actions={props.actions} />
);
const doneWithResults = status.tabulated || status.precinctsReportingPct === 1;

return (
<div className="top-results row-fluid section">
<div className="content-extra-large">
<div className="loading-bar">
{loadingBar}
<FetchRefresh fetch={props.fetch} actions={props.actions} hidden={doneWithResults} />
</div>
<div className="precincts-reporting-topline">
<div className="precincts-reporting-topline" hidden={doneWithResults}>
<span>Precincts reporting: {(status.precinctsReportingPct * 100).toFixed(1)}%</span>
</div>
<div className="bar">
<ResultsBar session={props.session} />
<div className="precincts-reporting-topline" hidden={!doneWithResults}>
<span>Precincts reporting: {(status.precinctsReportingPct * 100).toFixed(1)}%</span>
</div>
</div>
<div className="map">
<ResultsMap session={props.session} />
Expand Down
4 changes: 4 additions & 0 deletions theshow/staticapp/src/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ $usDemographic-container: '.demographic-map';
width: 100%;
margin: 0;
}

.precincts-reporting-topline {
margin-top: 0;
}
}
.map{
width: 60%;
Expand Down

0 comments on commit 4d5f08f

Please sign in to comment.