Skip to content

Commit

Permalink
Modularise timer display in <TopBar> component
Browse files Browse the repository at this point in the history
Relates #125
  • Loading branch information
martingaston committed Oct 17, 2018
1 parent 0510870 commit 28a0f22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/Pages/Revision/RevisionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export default class RevisionPage extends React.Component {
stationName={this.state.stationName}
submitCase={this.submitCase}
tickDisplayed={this.state.tickDisplayed}
timer
time={this.state.time}
/>
{this.state.resultsDisplayed ? resultsContainer : revisionContainer}
Expand Down
8 changes: 6 additions & 2 deletions src/components/TopBar/TopBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export default class TopBar extends React.Component {
<div id="topbar-container">
<BackButton link={this.props.backLink} />
<h3 id="topbar-title">{this.props.stationName}</h3>
<h3 id="topbar-timer">{timerFormat(this.props.time)}</h3>
{this.props.timer && (
<h3 id="topbar-timer">{timerFormat(this.props.time)}</h3>
)}
{this.props.tickDisplayed && (
<CompleteButton
exam={this.props.exam}
Expand All @@ -31,8 +33,10 @@ export default class TopBar extends React.Component {

TopBar.propTypes = {
backLink: PropTypes.string,
exam: PropTypes.string,
submitCase: PropTypes.func,
stationName: PropTypes.string,
tickDisplayed: PropTypes.bool,
time: PropTypes.number
time: PropTypes.number,
timer: PropTypes.bool
};

0 comments on commit 28a0f22

Please sign in to comment.