Skip to content
Snippets Groups Projects

Icons

Merged Levi Coffman requested to merge icons into master
3 files
+ 10
16
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 10
3
@@ -107,8 +107,6 @@ class Icon extends Component {
// Setup the update handler
this.updateListener = (event) => {
console.log("event");
let code = JSON.parse(event.data).CODE;
// Set the status
@@ -132,9 +130,18 @@ class Icon extends Component {
this.props.sse.removeEventListener(`update-${this.props.plantID}`, this.updateListener);
}
/**
* Called when this icon gets clicked on.
*
* @param event
*/
onClick = (event) => {
console.log(`Clicked on ${this.props.plantName}`);
};
render() {
return (
<IconDiv>
<IconDiv onClick={this.onClick} >
<Img className="IconImage" src={`icons/${this.props.plantID}.jpg`} alt="Icon"/>
<NameDiv>
{this.props.plantName}
Loading