mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
fix(Player): disable value labels of subtitles settings if value is null
This commit is contained in:
parent
cce556e639
commit
e6e05573cb
1 changed files with 5 additions and 1 deletions
|
|
@ -45,6 +45,10 @@ const Stepper = ({ className, label, value, unit, step, min, max, disabled, onCh
|
|||
return disabled || typeof value !== 'number' || (typeof max === 'number' && value >= max);
|
||||
}, [disabled, max, value]);
|
||||
|
||||
const valueLabel = useMemo(() => {
|
||||
return (disabled || typeof value !== 'number') ? '--' : `${value}${unit}`;
|
||||
}, [disabled, value, unit]);
|
||||
|
||||
const updateValue = useCallback((delta: number) => {
|
||||
onChange(clamp(localValue.current + delta, min, max));
|
||||
}, [onChange]);
|
||||
|
|
@ -88,7 +92,7 @@ const Stepper = ({ className, label, value, unit, step, min, max, disabled, onCh
|
|||
<Icon className={styles['icon']} name={'remove'} />
|
||||
</Button>
|
||||
<div className={styles['value']}>
|
||||
{ disabled ? '--' : `${value}${unit}` }
|
||||
{ valueLabel }
|
||||
</div>
|
||||
<Button
|
||||
className={classNames(styles['button'], { 'disabled': increaseDisabled })}
|
||||
|
|
|
|||
Loading…
Reference in a new issue