mirror of
https://github.com/urbit/shrub.git
synced 2024-12-30 07:35:19 +03:00
37 lines
697 B
JavaScript
37 lines
697 B
JavaScript
import React, { Component } from 'react';
|
|
|
|
export default class VolumeIcon extends Component {
|
|
|
|
constructor(props) {
|
|
super(props);
|
|
this.toggleSound = this.toggleSound.bind(this);
|
|
}
|
|
|
|
|
|
toggleSound() {
|
|
this.props.parent.setState( {playSound: !this.props.parent.state.playSound} )
|
|
}
|
|
|
|
render() {
|
|
let on = this.props.parent.state.playSound;
|
|
return <div> <a onClick={()=> {
|
|
this.toggleSound()}}>
|
|
<img src=
|
|
{
|
|
on
|
|
?
|
|
"~timer/img/volume-high.png"
|
|
:
|
|
"~timer/img/volume-mute.png"
|
|
}
|
|
style={{
|
|
width:"30px",
|
|
height:"30px"
|
|
}}
|
|
></img>
|
|
</a>
|
|
</div>
|
|
|
|
}
|
|
|
|
} |