Skip to content

Commit

Permalink
Merge pull request #951 from orontee/874-optional-volume-bar
Browse files Browse the repository at this point in the history
Show/Hide mute and volume control depending on volume value
  • Loading branch information
jaedb authored Oct 28, 2024
2 parents 15556f0 + 87ab260 commit 18c55ae
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/js/components/PlaybackControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,21 @@ const PlaybackControls = () => {
</button>
<OutputControl force_expanded={expanded} />
</section>

<section className="volume">
<MuteControl
mute={mute}
onMuteChange={(value) => dispatch(mopidyActions.setMute(value))}
/>
<VolumeControl
scrollWheel
volume={volume}
mute={mute}
onVolumeChange={(value) => dispatch(mopidyActions.setVolume(value))}
/>
</section>

{
volume !== null &&
<section className="volume">
<MuteControl
mute={mute}
onMuteChange={(value) => dispatch(mopidyActions.setMute(value))}
/>
<VolumeControl
scrollWheel
volume={volume}
mute={mute}
onVolumeChange={(value) => dispatch(mopidyActions.setVolume(value))}
/>
</section>
}
<section className="triggers">
<button
type="button"
Expand Down

0 comments on commit 18c55ae

Please sign in to comment.