Disable disallowed settings (#461)

This commit is contained in:
schroda
2023-11-19 00:10:30 +01:00
committed by GitHub
parent eda682d9ab
commit 1fd9b4e744
6 changed files with 80 additions and 85 deletions

View File

@@ -33,6 +33,7 @@ type BaseProps = {
valueUnit: string;
handleUpdate: (value: number) => void;
showSlider?: never;
disabled?: boolean;
};
type PropsWithSlider = Omit<BaseProps, 'defaultValue' | 'minValue' | 'maxValue' | 'showSlider'> &
@@ -53,6 +54,7 @@ export const NumberSetting = ({
valueUnit,
handleUpdate,
showSlider,
disabled = false,
}: Props) => {
const { t } = useTranslation();
@@ -94,7 +96,7 @@ export const NumberSetting = ({
return (
<>
<ListItemButton onClick={() => setIsDialogOpen(true)}>
<ListItemButton disabled={disabled} onClick={() => setIsDialogOpen(true)}>
{settingIcon ? <ListItemIcon>{settingIcon}</ListItemIcon> : null}
<ListItemText
primary={settingTitle}