Rewrite Field component as TextInput, extract styles to theme

This commit is contained in:
Alex Holliday committed 2024-11-21 15:54:02 +08:00
1 parent 1b51e580e5
commit e7fd4399ba
6 files changed
+425 -6

No files matched your search

+2 -2
View File
@@ -7,7 +7,7 @@
}
.field-infrastructure-alert .MuiInputBase-root:has(input) {
height: var(--env-var-height-2);
/* height: var(--env-var-height-2); */
}
.field h3.MuiTypography-root,
@@ -23,7 +23,7 @@
padding-right: var(--env-var-spacing-1-minus);
}
.field .MuiInputBase-root:has(input) {
height: var(--env-var-height-2);
/* height: var(--env-var-height-2); */
}
.field .MuiInputBase-root:has(.MuiInputAdornment-root) {
padding-right: var(--env-var-spacing-1-minus);
+4 -4
View File
@@ -46,7 +46,7 @@ const Field = forwardRef(
error,
disabled,
hidden,
className
className,
},
ref
) => {
@@ -186,11 +186,11 @@ const Field = forwardRef(
),
}}
/>
{ error && (
{error && (
<Typography
component="span"
className="input-error"
hidden={className? true: false}
hidden={className ? true : false}
color={theme.palette.error.main}
mt={theme.spacing(2)}
sx={{
@@ -225,7 +225,7 @@ Field.propTypes = {
error: PropTypes.string,
disabled: PropTypes.bool,
hidden: PropTypes.bool,
className: PropTypes.string
className: PropTypes.string,
};
export default Field;