From 3fbf97ea59a2239f3d98594b0dc44cb763c0776e Mon Sep 17 00:00:00 2001 From: Lanskikh Date: Thu, 9 Oct 2025 17:00:58 +0500 Subject: [PATCH] Add @uidotdev/usehooks dependency; enhance SettingsModal with microphone and speaker selection, volume control, and camera options; update Button and RangeInput components for improved functionality and styling. --- client/bun.lock | 3 + client/package.json | 1 + .../src/components/modals/SettingsModal.tsx | 153 +++++++++++++----- client/src/components/ui/Button.tsx | 2 +- client/src/components/ui/RangeInput.tsx | 2 +- client/src/components/ui/Select.tsx | 84 ++++++++++ 6 files changed, 205 insertions(+), 40 deletions(-) create mode 100644 client/src/components/ui/Select.tsx diff --git a/client/bun.lock b/client/bun.lock index e30e68a..333136a 100644 --- a/client/bun.lock +++ b/client/bun.lock @@ -5,6 +5,7 @@ "name": "client", "dependencies": { "@tanstack/react-query": "^5.90.2", + "@uidotdev/usehooks": "^2.4.1", "clsx": "^2.1.1", "ky": "^1.11.0", "react": "^19.1.1", @@ -237,6 +238,8 @@ "@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.45.0", "", { "dependencies": { "@typescript-eslint/types": "8.45.0", "eslint-visitor-keys": "^4.2.1" } }, "sha512-qsaFBA3e09MIDAGFUrTk+dzqtfv1XPVz8t8d1f0ybTzrCY7BKiMC5cjrl1O/P7UmHsNyW90EYSkU/ZWpmXelag=="], + "@uidotdev/usehooks": ["@uidotdev/usehooks@2.4.1", "", { "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-1I+RwWyS+kdv3Mv0Vmc+p0dPYH0DTRAo04HLyXReYBL9AeseDWUJyi4THuksBJcu9F0Pih69Ak150VDnqbVnXg=="], + "@vitejs/plugin-react-swc": ["@vitejs/plugin-react-swc@4.1.0", "", { "dependencies": { "@rolldown/pluginutils": "1.0.0-beta.35", "@swc/core": "^1.13.5" }, "peerDependencies": { "vite": "^4 || ^5 || ^6 || ^7" } }, "sha512-Ff690TUck0Anlh7wdIcnsVMhofeEVgm44Y4OYdeeEEPSKyZHzDI9gfVBvySEhDfXtBp8tLCbfsVKPWEMEjq8/g=="], "acorn": ["acorn@8.15.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg=="], diff --git a/client/package.json b/client/package.json index 22be199..9ca998f 100644 --- a/client/package.json +++ b/client/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@tanstack/react-query": "^5.90.2", + "@uidotdev/usehooks": "^2.4.1", "clsx": "^2.1.1", "ky": "^1.11.0", "react": "^19.1.1", diff --git a/client/src/components/modals/SettingsModal.tsx b/client/src/components/modals/SettingsModal.tsx index efec99f..d00a941 100644 --- a/client/src/components/modals/SettingsModal.tsx +++ b/client/src/components/modals/SettingsModal.tsx @@ -4,69 +4,146 @@ import VideoFilledIcon from "../icons/VideoFilledIcon"; import ModalWrapper from "../ModalWrapper"; import Button from "../ui/Button"; import RangeInput from "../ui/RangeInput"; +import Select from "../ui/Select"; +import MicrophoneFilledIcon from "../icons/MicrophoneFilledIcon"; +import Switch from "../ui/Switch"; + +const microphoneOptions = ["Realtek HD Microphone"]; +const speakerOptions = ["Realtek HD Audio"]; +const cameraOptions = ["Realtek HD Camera"]; function SettingsModal() { const [microphoneVolume, setMicrophoneVolume] = useState(50); - // const [speakerVolume, setSpeakerVolume] = useState(50); + const [speakerVolume, setSpeakerVolume] = useState(50); + + const [selectedMicrophone, setSelectedMicrophone] = useState( + microphoneOptions[0] + ); + const [selectedSpeaker, setSelectedSpeaker] = useState(speakerOptions[0]); + const [camera, setCamera] = useState(cameraOptions[0]); + + const [mediaType, setMediaType] = useState<"sound" | "video">("sound"); + + const [participantsVideosHidden, setParticipantsVideosHidden] = + useState(false); return ( -
+
- -
-
-
-

Микрофон

-
-
-
- -
-
-
- + {mediaType === "sound" && ( +
+
+

Микрофон

+
+
+ + +
+
+
+ +
+ +

+ {speakerVolume.toFixed(0)}% +

+
+
+
+
+ )} + {mediaType === "video" && ( +
+
+

Камера

+