diff --git a/src/qqq/components/forms/BooleanFieldSwitch.tsx b/src/qqq/components/forms/BooleanFieldSwitch.tsx
index b9bf72d..00cbc62 100644
--- a/src/qqq/components/forms/BooleanFieldSwitch.tsx
+++ b/src/qqq/components/forms/BooleanFieldSwitch.tsx
@@ -19,13 +19,14 @@
* along with this program. If not, see .
*/
-import {InputLabel} from "@mui/material";
+import {Box, InputLabel} from "@mui/material";
import Stack from "@mui/material/Stack";
import {styled} from "@mui/material/styles";
import Switch from "@mui/material/Switch";
import Typography from "@mui/material/Typography";
import {useFormikContext} from "formik";
import React, {SyntheticEvent} from "react";
+import colors from "qqq/assets/theme/base/colors";
const AntSwitch = styled(Switch)(({theme}) => ({
width: 28,
@@ -60,6 +61,9 @@ const AntSwitch = styled(Switch)(({theme}) => ({
duration: 200,
}),
},
+ "&.nullSwitch .MuiSwitch-thumb": {
+ width: 24,
+ },
"& .MuiSwitch-track": {
borderRadius: 16 / 2,
opacity: 1,
@@ -78,6 +82,7 @@ interface Props
}
+
function BooleanFieldSwitch({name, label, value, isDisabled}: Props) : JSX.Element
{
const {setFieldValue} = useFormikContext();
@@ -96,8 +101,10 @@ function BooleanFieldSwitch({name, label, value, isDisabled}: Props) : JSX.Eleme
setFieldValue(name, !value);
}
+ const classNullSwitch = (value === null || value == undefined || `${value}` == "") ? "nullSwitch" : "";
+
return (
- <>
+
{label}
No
-
+
- >
+
);
}