Skip to content

Commit 28a0f22

Browse files
committed
Modularise timer display in <TopBar> component
Relates #125
1 parent 0510870 commit 28a0f22

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/components/Pages/Revision/RevisionPage.js

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export default class RevisionPage extends React.Component {
9999
stationName={this.state.stationName}
100100
submitCase={this.submitCase}
101101
tickDisplayed={this.state.tickDisplayed}
102+
timer
102103
time={this.state.time}
103104
/>
104105
{this.state.resultsDisplayed ? resultsContainer : revisionContainer}

src/components/TopBar/TopBar.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export default class TopBar extends React.Component {
1515
<div id="topbar-container">
1616
<BackButton link={this.props.backLink} />
1717
<h3 id="topbar-title">{this.props.stationName}</h3>
18-
<h3 id="topbar-timer">{timerFormat(this.props.time)}</h3>
18+
{this.props.timer && (
19+
<h3 id="topbar-timer">{timerFormat(this.props.time)}</h3>
20+
)}
1921
{this.props.tickDisplayed && (
2022
<CompleteButton
2123
exam={this.props.exam}
@@ -31,8 +33,10 @@ export default class TopBar extends React.Component {
3133

3234
TopBar.propTypes = {
3335
backLink: PropTypes.string,
36+
exam: PropTypes.string,
3437
submitCase: PropTypes.func,
3538
stationName: PropTypes.string,
3639
tickDisplayed: PropTypes.bool,
37-
time: PropTypes.number
40+
time: PropTypes.number,
41+
timer: PropTypes.bool
3842
};

0 commit comments

Comments
 (0)