mirror of
https://github.com/remvze/moodist.git
synced 2025-11-02 02:27:02 -05:00
feat: add better aria labels
This commit is contained in:
parent
9774532308
commit
98e5021f56
@ -29,6 +29,7 @@ export function Item({
|
|||||||
className={styles.item}
|
className={styles.item}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
{...(href ? { href, target: '_blank' } : {})}
|
{...(href ? { href, target: '_blank' } : {})}
|
||||||
|
aria-label={label}
|
||||||
>
|
>
|
||||||
<span className={styles.label}>
|
<span className={styles.label}>
|
||||||
<span className={styles.icon}>{icon}</span> {label}
|
<span className={styles.icon}>{icon}</span> {label}
|
||||||
|
|||||||
@ -4,16 +4,17 @@ import styles from './range.module.css';
|
|||||||
|
|
||||||
interface RangeProps {
|
interface RangeProps {
|
||||||
id: string;
|
id: string;
|
||||||
|
label: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Range({ id }: RangeProps) {
|
export function Range({ id, label }: RangeProps) {
|
||||||
const setVolume = useSoundStore(state => state.setVolume);
|
const setVolume = useSoundStore(state => state.setVolume);
|
||||||
const volume = useSoundStore(state => state.sounds[id].volume);
|
const volume = useSoundStore(state => state.sounds[id].volume);
|
||||||
const isSelected = useSoundStore(state => state.sounds[id].isSelected);
|
const isSelected = useSoundStore(state => state.sounds[id].isSelected);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<input
|
<input
|
||||||
aria-labelledby={id}
|
aria-label={`${label} sound volume`}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
className={styles.range}
|
className={styles.range}
|
||||||
disabled={!isSelected}
|
disabled={!isSelected}
|
||||||
|
|||||||
@ -105,7 +105,7 @@ export function Sound({
|
|||||||
<div className={styles.label} id={id}>
|
<div className={styles.label} id={id}>
|
||||||
{label}
|
{label}
|
||||||
</div>
|
</div>
|
||||||
<Range id={id} />
|
<Range id={id} label={label} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user