Style filter input (#724)

* refactor: reduce duplicate code

* style: add a white background to the light color theme to avoid the gray text being too light
This commit is contained in:
cismous
2024-03-30 01:14:03 +08:00
committed by GitHub
parent fd84e56c00
commit ca8e3179bb
5 changed files with 57 additions and 65 deletions

View File

@@ -0,0 +1,24 @@
import { TextField, type TextFieldProps, styled } from "@mui/material";
import { useTranslation } from "react-i18next";
export const BaseStyledTextField = styled((props: TextFieldProps) => {
const { t } = useTranslation();
return (
<TextField
hiddenLabel
fullWidth
size="small"
autoComplete="off"
variant="outlined"
spellCheck="false"
placeholder={t("Filter conditions")}
sx={{ input: { py: 0.65, px: 1.25 } }}
{...props}
/>
);
})(({ theme }) => ({
"& .MuiInputBase-root": {
background: theme.palette.mode === "light" ? "#fff" : undefined,
},
}));