Skip to content

Commit

Permalink
fix(style): condition for class name on Sound
Browse files Browse the repository at this point in the history
Add condition to use the class 'selected', if true the class will be used, otherwise it will return
an empty string
  • Loading branch information
mateusfg7 committed Sep 1, 2020
1 parent 7c5aef4 commit 128f866
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/components/Sound/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,10 @@ export default function Sound({

<SoundButton
id={`${name}-button`}
className={state ? 'selected' : ''}
onClick={() => {
const audio = document.querySelector<HTMLAudioElement>(`#${name}`);
const button = document.getElementById(`${name}-button`);
const audioController = document.getElementById(
`${name}-audio-controller`
);
changeStateOfAudio(audio, state, setState, button, audioController);
changeStateOfAudio(audio, state, setState);
}}
>
<i className={`${icons[name]} icons`} />
Expand All @@ -52,6 +49,7 @@ export default function Sound({
<VolumeController
audioObject={document.querySelector<HTMLAudioElement>(`#${name}`)}
id={`${name}-audio-controller`}
state={state}
/>
</SoundComponent>
);
Expand Down

0 comments on commit 128f866

Please sign in to comment.