diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-04-19 16:47:28 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-04-19 16:47:28 +0200 |
| commit | c5a6bfea8aa89900ae6d072313eef02948c79658 (patch) | |
| tree | 1a201c3d6d1356ee8aeaaed22068c62ae61d9caa /frontend/site/audio/mute.button.js | |
| parent | 03b78c302023ff296a8b4200801fa9de7291eed8 (diff) | |
mute button. muting audio
Diffstat (limited to 'frontend/site/audio/mute.button.js')
| -rw-r--r-- | frontend/site/audio/mute.button.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/frontend/site/audio/mute.button.js b/frontend/site/audio/mute.button.js new file mode 100644 index 0000000..c2606d3 --- /dev/null +++ b/frontend/site/audio/mute.button.js @@ -0,0 +1,18 @@ +import React from 'react' +import { connect } from 'react-redux' + +import { VolumeOn, VolumeOff } from './audio.icons' + +import actions from 'site/actions' + +const MuteButton = ({ muted }) => ( + <div className="mute" onClick={muted ? actions.audio.unmute : actions.audio.mute}> + {muted ? VolumeOff : VolumeOn} + </div> +) + +const mapStateToProps = state => ({ + muted: state.audio.muted, +}) + +export default connect(mapStateToProps)(MuteButton) |
