Skip to content

Commit

Permalink
use destructuring, relates #158
Browse files Browse the repository at this point in the history
  • Loading branch information
Brymon committed Oct 19, 2018
1 parent 7e88429 commit b06d26a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
14 changes: 3 additions & 11 deletions src/components/Pages/Revision/RevisionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,15 @@ export default class RevisionPage extends React.Component {
id="revision"
markComplete={this.markComplete}
swipe={this.swipe}
caseTitle={this.state.caseTitle}
caseDetails={this.state.caseDetails}
caseDetailsDisplayed={this.state.caseDetailsDisplayed}
markSchemeElements={this.state.markSchemeElements}
markSchemeCompleted={this.state.markSchemeCompleted}
{...this.state}
/>
);

const resultsContainer = (
<ResultsContainer
markSchemeTotal={this.state.markSchemeElements.length}
markSchemeCompleted={this.state.markSchemeCompleted}
markSchemeElements={this.state.markSchemeElements}
caseTitle={this.state.caseTitle}
timeElapsed={this.state.time}
{...this.state}
/>
);
const { exam, station } = this.props.match.params;
Expand All @@ -98,11 +92,9 @@ export default class RevisionPage extends React.Component {
<TopBar
id="topbar"
backLink={`${exam}/${station}`}
stationName={this.state.stationName}
submitCase={this.submitCase}
tickDisplayed={this.state.tickDisplayed}
timer
time={this.state.time}
{...this.state}
/>
{this.state.resultsDisplayed ? resultsContainer : revisionContainer}
</React.Fragment>
Expand Down
4 changes: 1 addition & 3 deletions src/components/TopBar/TopBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ export default class TopBar extends React.Component {
)}
{this.props.tickDisplayed && (
<CompleteButton
addNewFlow={this.props.addNewFlow}
exam={this.props.backLink}
station={this.props.station}
onClick={this.props.submitCase}
tickDisplayed={this.props.tickDisplayed}
{...this.props}
/>
)}
</TopBarContainer>
Expand Down

0 comments on commit b06d26a

Please sign in to comment.