From fd2cd38e4d02d72462e101d37594f714fc811668 Mon Sep 17 00:00:00 2001 From: Sandra Larsson Date: Thu, 19 Dec 2024 09:07:39 +0100 Subject: [PATCH] fix: only keep volume controls on desktop (#257) --- src/assets/icons/icon.tsx | 6 --- src/assets/icons/minus.svg | 3 -- src/assets/icons/plus.svg | 3 -- .../production-line/production-line.tsx | 22 +++-------- .../volume-slider/volume-slider.tsx | 39 +------------------ 5 files changed, 7 insertions(+), 66 deletions(-) delete mode 100644 src/assets/icons/minus.svg delete mode 100644 src/assets/icons/plus.svg diff --git a/src/assets/icons/icon.tsx b/src/assets/icons/icon.tsx index 93693b3..bbb6faa 100644 --- a/src/assets/icons/icon.tsx +++ b/src/assets/icons/icon.tsx @@ -12,8 +12,6 @@ import RefreshSvg from "./refresh.svg?react"; import Settings from "./settings.svg?react"; import NoSound from "./no_sound.svg?react"; import FullSound from "./full_sound.svg?react"; -import Minus from "./minus.svg?react"; -import Plus from "./plus.svg?react"; import Headset from "./headset.svg?react"; import UserSettings from "./user_settings.svg?react"; import ChevronDown from "./chevron_down.svg?react"; @@ -51,10 +49,6 @@ export const NoSoundIcon = () => ; export const FullSoundIcon = () => ; -export const MinusIcon = () => ; - -export const PlusIcon = () => ; - export const UserSettingsIcon = () => ; export const ChevronDownIcon = () => ; diff --git a/src/assets/icons/minus.svg b/src/assets/icons/minus.svg deleted file mode 100644 index eacef25..0000000 --- a/src/assets/icons/minus.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/assets/icons/plus.svg b/src/assets/icons/plus.svg deleted file mode 100644 index be10a07..0000000 --- a/src/assets/icons/plus.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/components/production-line/production-line.tsx b/src/components/production-line/production-line.tsx index 09aa40a..7e356d1 100644 --- a/src/components/production-line/production-line.tsx +++ b/src/components/production-line/production-line.tsx @@ -204,21 +204,11 @@ export const ProductionLine = ({ setValue(newValue); audioElements?.forEach((audioElement) => { - console.log("Setting volume to: ", newValue); // eslint-disable-next-line no-param-reassign audioElement.volume = newValue; }); }; - const handleVolumeButtonClick = (type: "increase" | "decrease") => { - const newValue = - type === "increase" - ? Math.min(value + 0.05, 1) - : Math.max(value - 0.05, 0); - setValue(newValue); - // TODO: Fix for iOS - }; - useHotkeys(savedHotkeys.increaseVolumeHotkey || "u", () => { const newValue = Math.min(value + 0.05, 1); setValue(newValue); @@ -503,12 +493,12 @@ export const ProductionLine = ({ }} > Controls - - + {!isMobile && ( + + )} ` cursor: pointer; `; -const VolumeButton = styled(ActionButton)` - background-color: #32383b; - width: 7rem; - align-items: center; - height: 4.5rem; - padding: 1.5rem; - cursor: pointer; - margin-top: 1rem; - border: 0.2rem solid #6d6d6d; -`; - -const VolumeButtonContainer = styled.div` - display: flex; - flex-direction: row; - justify-content: space-between; - width: 100%; -`; - const VolumeWrapper = styled.div` display: flex; flex-direction: row; @@ -78,13 +53,11 @@ const VolumeWrapper = styled.div` type TVolumeSliderProps = { value: number; handleInputChange: (e: React.ChangeEvent) => void; - handleVolumeButtonClick: (type: "increase" | "decrease") => void; }; export const VolumeSlider: FC = ({ handleInputChange, value, - handleVolumeButtonClick, }) => { const thumbPosition = value * 100; @@ -122,16 +95,6 @@ export const VolumeSlider: FC = ({ - {isMobile && ( - - handleVolumeButtonClick("decrease")}> - - - handleVolumeButtonClick("increase")}> - - - - )} ); };