Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
😊 Updated the board for the answers.
- Loading branch information
1 parent
cd0bf7a
commit cc047fb
Showing
4 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,33 @@ | ||
import React, { Component } from 'react'; | ||
import React, { Component, PropTypes } from 'react'; | ||
|
||
export default class Board extends Component { | ||
import Display from './parts/Display'; | ||
|
||
class Board extends Component { | ||
render() { | ||
return ( | ||
<h1>Board {this.props.title}</h1> | ||
<div id="scoreboard"> | ||
<Display if={this.props.status === 'connected' && | ||
this.props.currentQuestion}> | ||
<h3>{this.props.currentQuestion.q}</h3> | ||
<p>{JSON.stringify(this.props.results)}</p> | ||
</Display> | ||
|
||
<Display if={this.props.status === 'connected' && | ||
!this.props.currentQuestion}> | ||
<h3>Awaiting a question...</h3> | ||
</Display> | ||
|
||
</div> | ||
); | ||
} | ||
}; | ||
} | ||
|
||
Board.propTypes = { | ||
status: PropTypes.string, | ||
currentQuestion: PropTypes.oneOfType([ | ||
PropTypes.object.isRequired, | ||
PropTypes.bool.isRequired | ||
]) | ||
}; | ||
|
||
export default Board; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters