- WIP Replace Field with TextInput , HttpAdornment seems not working

This commit is contained in:
Shemy Gan committed 2024-12-06 10:06:56 -05:00
1 parent df36f873ae
commit 5df7ddbe0f
1 file changed
+9 -11
@@ -3,11 +3,9 @@ import { Button, Box, Stack, Typography } from "@mui/material";
import { ConfigBox } from "../../../Pages/Settings/styled";
import Checkbox from "../../Inputs/Checkbox";
import { useTheme } from "@emotion/react";
import { useDispatch, useSelector } from "react-redux";
import TabPanel from "@mui/lab/TabPanel";
import Field from "../../Inputs/Field";
import TextInput from "../../Inputs/TextInput";
import ImageField from "../../Inputs/Image";
import { setMode, setTimezone } from "../../../Features/UI/uiSlice";
import timezones from "../../../Utils/timezones.json";
import Select from "../../Inputs/Select"
import { logoImageValidation, publicPageGeneralSettingsValidation } from "../../../Validation/validation"
@@ -15,10 +13,10 @@ import { buildErrors } from "../../../Validation/error";
import { formatBytes } from "../../../Utils/fileUtils";
import ProgressUpload from "../../ProgressBars";
import ImageIcon from "@mui/icons-material/Image";
import { HttpAdornment } from "../../Inputs/TextInput/Adornments";
const GeneralSettingsPanel = () => {
const theme = useTheme();
const dispatch = useDispatch();
const [errors, setErrors] = useState({});
const [logo, setLogo] = useState();
const [progress, setProgress] = useState({ value: 0, isLoading: false });
@@ -170,7 +168,7 @@ const GeneralSettingsPanel = () => {
</Stack>
</Box>
<Stack gap={theme.spacing(6)}>
<Field
<TextInput
id="companyName"
type="text"
label="Company name"
@@ -179,20 +177,19 @@ const GeneralSettingsPanel = () => {
onBlur={handleBlur}
error={errors["companyName"]}
/>
<Field
<TextInput
id="url"
type="url"
label="SubURL"
placeholder={""}
value={localData.url}
prefix={"http://uptimegenie.com/"}
startAdornment={<HttpAdornment https={true} />}
//prefix={"http://uptimegenie.com/"}
onChange={handleChange}
onBlur={handleBlur}
error={errors["url"]}
/>
</Stack>
</ConfigBox>
<ConfigBox>
<Box>
<Stack gap={theme.spacing(6)}>
@@ -212,7 +209,6 @@ const GeneralSettingsPanel = () => {
items={timezones}
error={errors["display-timezone"]}
/>
<ImageField
id="logo"
src={localData.logo?.src ?? logo?.src}
@@ -231,6 +227,7 @@ const GeneralSettingsPanel = () => {
) : (
""
)}
{logo?.src && (
<Stack
direction="row"
mt={theme.spacing(10)}
@@ -258,7 +255,8 @@ const GeneralSettingsPanel = () => {
Update
</Button>
</Stack>
<Field
)}
<TextInput
id="color"
label="Color"
value={localData.color}