@@ -8,7 +8,7 @@ Please see LICENSE in the repository root for full details.
88import { ChangeEvent , FC , ReactNode , useCallback } from "react" ;
99import { Trans , useTranslation } from "react-i18next" ;
1010import { MatrixClient } from "matrix-js-sdk/src/matrix" ;
11- import { Dropdown , Text } from "@vector-im/compound-web" ;
11+ import { Dropdown , Separator , Text } from "@vector-im/compound-web" ;
1212
1313import { Modal } from "../Modal" ;
1414import styles from "./SettingsModal.module.css" ;
@@ -28,9 +28,11 @@ import {
2828 developerSettingsTab as developerSettingsTabSetting ,
2929 duplicateTiles as duplicateTilesSetting ,
3030 useOptInAnalytics ,
31+ effectSoundVolume ,
3132} from "./settings" ;
3233import { isFirefox } from "../Platform" ;
3334import { PreferencesSettingsTab } from "./PreferencesSettingsTab" ;
35+ import { Slider } from "../Slider" ;
3436
3537type SettingsTab =
3638 | "audio"
@@ -116,6 +118,8 @@ export const SettingsModal: FC<Props> = ({
116118 const devices = useMediaDevices ( ) ;
117119 useMediaDeviceNames ( devices , open ) ;
118120
121+ const [ soundVolume , setSoundVolume ] = useSetting ( effectSoundVolume ) ;
122+
119123 const audioTab : Tab < SettingsTab > = {
120124 key : "audio" ,
121125 name : t ( "common.audio" ) ,
@@ -127,6 +131,19 @@ export const SettingsModal: FC<Props> = ({
127131 devices . audioOutput ,
128132 t ( "settings.speaker_device_selection_label" ) ,
129133 ) }
134+ < Separator />
135+ < div className = { styles . volumeSlider } >
136+ < label > { t ( "settings.audio_tab.effect_volume_label" ) } </ label >
137+ < p > { t ( "settings.audio_tab.effect_volume_description" ) } </ p >
138+ < Slider
139+ label = { t ( "video_tile.volume" ) }
140+ value = { soundVolume }
141+ onValueChange = { setSoundVolume }
142+ min = { 0 }
143+ max = { 1 }
144+ step = { 0.01 }
145+ />
146+ </ div >
130147 </ >
131148 ) ,
132149 } ;
0 commit comments