Skip to content

Instantly share code, notes, and snippets.

@Jtmaca9
Created February 18, 2016 02:00
Show Gist options
  • Save Jtmaca9/c611f42f844837e154bb to your computer and use it in GitHub Desktop.
Save Jtmaca9/c611f42f844837e154bb to your computer and use it in GitHub Desktop.
var React = require('react');
var VoteButton = React.createClass({
getInitialState: function(){
return{
voteButtonText: ''
}
},
onComponentDidMount: function(){
},
getVoteButtonText: function(){
if(this.props.duringRound && !this.props.chosenWord.length){
return <div><span id="voteText">Choose a word <span className="or">or</span> Enter your own</span><span id="vote-label" className="label label-lg"></span><span id="vote-button-label" className="label label-lg">{this.props.time}</span></div>;
}else if(this.props.duringRound && this.props.chosenWord.length){
return <div><span id="voteText">Vote for {this.props.chosenWord}</span><span id="vote-label" className="label label-lg"></span><span id="vote-button-label" className="label label-lg">{this.props.time}</span></div>;
}
},
render: function(){
return (
<div>
<nav className="navbar navbar-default navbar-fixed-bottom myNavbar">
<button id="voteButton" className="btn btn-primary voteButton" form="voteForm">
{this.getVoteButtonText}
</button>
</nav>
</div>
)
}
});
module.exports = VoteButton;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment