diff --git a/src/components/Icon.tsx b/src/components/Icon.tsx index 51bd0de6..611c7a2d 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,6 +100,8 @@ const iconList: Record = { expand: ``, compress: ``, volume: ``, + volume_med: ``, + volume_low: ``, volume_x: ``, x: ``, edit: ``, diff --git a/src/components/player/atoms/Volume.tsx b/src/components/player/atoms/Volume.tsx index 62662de1..aca9f8f4 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} /> +