- update to match BE

This commit is contained in:
Shemy Gan committed 2024-12-06 10:00:59 -05:00
1 parent 5adffd8c1e
commit 2405d017ec
1 file changed
+15 -9
@@ -14,13 +14,19 @@ import Select from "../../Inputs/Select"
const GeneralSettingsPanel = () => { const GeneralSettingsPanel = () => {
const theme = useTheme(); const theme = useTheme();
const dispatch = useDispatch(); const dispatch = useDispatch();
const [error, setError] = useState("");
// Local state for form data, errors, and file handling
const [localData, setLocalData] = useState({});
const [errors, setErrors] = useState({}); const [errors, setErrors] = useState({});
const [file, setFile] = useState(); const [file, setFile] = useState();
const { timezone } = useSelector((state) => state.ui); // Local state for form data, errors, and file handling
const { mode } = useSelector((state) => state.ui); const [localData, setLocalData] = useState({
companyName: "",
url: "",
timezone: "America/Toronto",
color: "#4169E1",
theme: "light",
//which fields matching below?
publish: false,
file: null
});
const handleChange = (event, appendedId) => { const handleChange = (event, appendedId) => {
event.preventDefault(); event.preventDefault();
@@ -72,8 +78,8 @@ const GeneralSettingsPanel = () => {
<Checkbox <Checkbox
id="published-to-public" id="published-to-public"
label={`Published and visible to the public`} label={`Published and visible to the public`}
isChecked={false} isChecked={localData.publish}
value={"dd"} value={localData.publish}
onChange={handleChange} onChange={handleChange}
onBlur={handleBlur} onBlur={handleBlur}
/> />
@@ -94,7 +100,7 @@ const GeneralSettingsPanel = () => {
id="company-name" id="company-name"
type="text" type="text"
label="Company name" label="Company name"
value={localData.name} value={localData.companyName}
/> />
<Field <Field
id="suburl" id="suburl"
@@ -141,7 +147,7 @@ const GeneralSettingsPanel = () => {
<Select <Select
id="theme" id="theme"
label="Theme" label="Theme"
value={localData.mode} value={localData.theme}
onChange={(e) => { onChange={(e) => {
dispatch(setMode(e.target.value)); dispatch(setMode(e.target.value));
}} }}