Skip to content

Commit

Permalink
Sound effect volume adjustment & tooltip (#2762)
Browse files Browse the repository at this point in the history
* Set the default sound effect volume to 50%.

* Add a tooltip to describe the current volume level.

* lint import
  • Loading branch information
Half-Shot authored Nov 12, 2024
1 parent 3535cbe commit c4c2665
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Please see LICENSE in the repository root for full details.
import { FC, useCallback } from "react";
import { Root, Track, Range, Thumb } from "@radix-ui/react-slider";
import classNames from "classnames";
import { Tooltip } from "@vector-im/compound-web";

import styles from "./Slider.module.css";

Expand Down Expand Up @@ -66,7 +67,10 @@ export const Slider: FC<Props> = ({
<Track className={styles.track}>
<Range className={styles.highlight} />
</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>
);
};
2 changes: 1 addition & 1 deletion src/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const playReactionsSound = new Setting<boolean>(

export const soundEffectVolumeSetting = new Setting<number>(
"sound-effect-volume",
1,
0.5,
);

export const alwaysShowSelf = new Setting<boolean>("always-show-self", true);

0 comments on commit c4c2665

Please sign in to comment.