mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
grey out label if disabled (for system sensors)
This commit is contained in:
@@ -21,7 +21,16 @@ const ValidatedTextField: FC<ValidatedTextFieldProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TextField error={!!errors} {...rest} aria-label="Error" />
|
<TextField
|
||||||
|
error={!!errors}
|
||||||
|
{...rest}
|
||||||
|
aria-label="Error"
|
||||||
|
slotProps={{
|
||||||
|
inputLabel: {
|
||||||
|
style: rest.disabled ? { color: 'grey' } : undefined
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
{errors?.map((e) => (
|
{errors?.map((e) => (
|
||||||
<FormHelperText key={e.message} sx={{ color: 'rgb(250, 95, 84)' }}>
|
<FormHelperText key={e.message} sx={{ color: 'rgb(250, 95, 84)' }}>
|
||||||
{e.message}
|
{e.message}
|
||||||
|
|||||||
Reference in New Issue
Block a user