Skip to content
Snippets Groups Projects
Commit 613dfefb authored by Thomas Roos's avatar Thomas Roos
Browse files

fake status changes of feedback

parent c02a6438
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,8 @@ import React from 'react';
class FeedbackBlock extends React.Component {
state = {
hover: false
hover: false,
checked: false
}
leave = () => {
this.setState({
......@@ -20,14 +21,22 @@ class FeedbackBlock extends React.Component {
console.log('mounting! ' + this.props.feedback.id)
}
toggle = () => {
if (!this.state.hover) {
this.setState({
checked: !this.state.checked
})
}
}
render() {
const score = this.props.feedback.score;
return (
<a className="panel-block is-active" onClick={() => !this.state.hover && console.log('a click')} >
<a className="panel-block is-active" onClick={this.toggle} >
<span className="panel-icon">
<i className={"fa fa-" + (this.props.checked ? "check-square-o" : "square-o")}></i>
<i className={"fa fa-" + (this.state.checked ? "check-square-o" : "square-o")}></i>
</span>
<span style={{ width: '80%' }}>
{this.props.feedback.name}
......
......@@ -49,7 +49,7 @@ class FeedbackPanel extends React.Component {
Feedback
</p>
{this.state.feedback.map((feedback, i) =>
<FeedbackBlock key={i} index={i} feedback={feedback} checked={true} onClick={this.props.editFeedback} />
<FeedbackBlock key={i} index={i} feedback={feedback} checked={false} onClick={this.props.editFeedback} />
)}
<div className="panel-block is-hidden-mobile">
<button className="button is-link is-outlined is-fullwidth" onClick={this.props.toggleEdit}>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment