- added sounds for all hotlist sounds
This commit is contained in:
@@ -4,7 +4,20 @@ import { useSoundContext } from "../../context/SoundContext";
|
||||
|
||||
const SliderComponent = ({ soundCategory }: { soundCategory: "SIGHTINGVOLUME" | "NPEDVOLUME" | "HOTLISTVOLUME" }) => {
|
||||
const { dispatch, state } = useSoundContext();
|
||||
const volume = soundCategory === "SIGHTINGVOLUME" ? state.sightingVolume : state.NPEDsoundVolume;
|
||||
|
||||
const getVolumeOption = (soundCategory: string) => {
|
||||
if (soundCategory === "SIGHTINGVOLUME") {
|
||||
return state.sightingVolume;
|
||||
}
|
||||
if (soundCategory === "NPEDVOLUME") {
|
||||
return state.NPEDsoundVolume;
|
||||
}
|
||||
if (soundCategory === "HOTLISTVOLUME") {
|
||||
return state.hotlistSoundVolume;
|
||||
}
|
||||
};
|
||||
|
||||
const volume = getVolumeOption(soundCategory);
|
||||
|
||||
const handleChange = (value: number | number[]) => {
|
||||
const number = typeof value === "number" ? value : value[0];
|
||||
@@ -39,7 +52,7 @@ const SliderComponent = ({ soundCategory }: { soundCategory: "SIGHTINGVOLUME" |
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<span>{volume * 10}</span>
|
||||
<span>{volume ? volume * 10 : 1}</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user