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

Improved visuals feedback block

parent 0b340844
No related branches found
No related tags found
No related merge requests found
......@@ -2,17 +2,40 @@ import React from 'react';
class FeedbackBlock extends React.Component {
state = {
hover: false
}
leave = () => {
this.setState({
hover: false
})
}
enter = () => {
this.setState({
hover: true
})
}
render() {
const score = this.props.feedback.score;
return (
<a className="panel-block is-active" onClick={this.props.onClick} >
<a className="panel-block is-active" onClick={() => !this.state.hover && console.log('a click')} >
<span className="panel-icon">
<i className={"fa fa-" + (this.props.checked ? "check-square-o" : "square-o")}></i>
</span>
<div style={{ width: '80%' }}>
<span style={{ width: '80%' }}>
{this.props.feedback.name}
</span>
<div className="field is-grouped">
<div className="control" onMouseEnter={this.enter} onMouseLeave={this.leave} >
<div className="tags has-addons">
{score ? <span className="tag is-link">{this.props.feedback.score}</span> : null}
<span className={"tag" + (this.state.hover ? " is-white" : "")} onClick={() => console.log('pencil click')}> <i className="fa fa-pencil"></i></span>
</div>
</div>
</div>
<i>{this.props.feedback.score}</i>
</a>
)
}
......
......@@ -21,7 +21,7 @@ class ProblemSelector extends React.Component {
render() {
return (
<div className="field">
<label className="label">Problem:</label>
<label className="label">Problem</label>
<div className="control has-icons-left">
<div className="select is-fullwidth">
<select value={this.props.name}
......
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