mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 17:15:38 +08:00
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:
24
src/components/base/base-styled-text-field.tsx
Normal file
24
src/components/base/base-styled-text-field.tsx
Normal 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,
|
||||
},
|
||||
}));
|
||||
Reference in New Issue
Block a user