Sound effect volume adjustment & tooltip (#2762)
* Set the default sound effect volume to 50%. * Add a tooltip to describe the current volume level. * lint import
This commit is contained in:
@@ -8,6 +8,7 @@ Please see LICENSE in the repository root for full details.
|
|||||||
import { FC, useCallback } from "react";
|
import { FC, useCallback } from "react";
|
||||||
import { Root, Track, Range, Thumb } from "@radix-ui/react-slider";
|
import { Root, Track, Range, Thumb } from "@radix-ui/react-slider";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
|
import { Tooltip } from "@vector-im/compound-web";
|
||||||
|
|
||||||
import styles from "./Slider.module.css";
|
import styles from "./Slider.module.css";
|
||||||
|
|
||||||
@@ -66,7 +67,10 @@ export const Slider: FC<Props> = ({
|
|||||||
<Track className={styles.track}>
|
<Track className={styles.track}>
|
||||||
<Range className={styles.highlight} />
|
<Range className={styles.highlight} />
|
||||||
</Track>
|
</Track>
|
||||||
<Thumb className={styles.handle} aria-label={label} />
|
{/* Note: This is expected not to be visible on mobile.*/}
|
||||||
|
<Tooltip placement="top" label={Math.round(value * 100).toString() + "%"}>
|
||||||
|
<Thumb className={styles.handle} aria-label={label} />
|
||||||
|
</Tooltip>
|
||||||
</Root>
|
</Root>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ export const playReactionsSound = new Setting<boolean>(
|
|||||||
|
|
||||||
export const soundEffectVolumeSetting = new Setting<number>(
|
export const soundEffectVolumeSetting = new Setting<number>(
|
||||||
"sound-effect-volume",
|
"sound-effect-volume",
|
||||||
1,
|
0.5,
|
||||||
);
|
);
|
||||||
|
|
||||||
export const alwaysShowSelf = new Setting<boolean>("always-show-self", true);
|
export const alwaysShowSelf = new Setting<boolean>("always-show-self", true);
|
||||||
|
|||||||
Reference in New Issue
Block a user