diff --git a/src/components/Icon.tsx b/src/components/Icon.tsx index 51bd0de66..4ff1d34cb 100644 --- a/src/components/Icon.tsx +++ b/src/components/Icon.tsx @@ -27,6 +27,8 @@ export enum Icons { EXPAND = "expand", COMPRESS = "compress", VOLUME = "volume", + VOLUME_MED = "volume_med", + VOLUME_LOW = "volume_low", VOLUME_X = "volume_x", X = "x", EDIT = "edit", @@ -98,7 +100,9 @@ const iconList: Record = { expand: ``, compress: ``, volume: ``, - volume_x: ``, + volume_med: ``, + volume_low: ``, + volume_x: ``, x: ``, edit: ``, bookmark_outline: ``, diff --git a/src/components/player/atoms/Volume.tsx b/src/components/player/atoms/Volume.tsx index 62662de1f..aca9f8f40 100644 --- a/src/components/player/atoms/Volume.tsx +++ b/src/components/player/atoms/Volume.tsx @@ -62,6 +62,19 @@ export function Volume(props: Props) { [volume, setVolume], ); + const getVolumeIcon = (volumeLevel: number) => { + if (volumeLevel === 0) { + return Icons.VOLUME_X; + } + if (volumeLevel > 0 && volumeLevel <= 0.33) { + return Icons.VOLUME_LOW; + } + if (volumeLevel > 0.33 && volumeLevel <= 0.66) { + return Icons.VOLUME_MED; + } + return Icons.VOLUME; + }; + return (
- 0 ? Icons.VOLUME : Icons.VOLUME_X} /> +