feat: resolve #2598 improve timezone search UX
This commit is contained in:
1 parent
c54e6b0b34
commit
95e82cf254
1 file changed
+17
-6
@@ -4,7 +4,7 @@ import { TabPanel } from "@mui/lab";
|
|||||||
import ConfigBox from "../../../../../Components/ConfigBox";
|
import ConfigBox from "../../../../../Components/ConfigBox";
|
||||||
import Checkbox from "../../../../../Components/Inputs/Checkbox";
|
import Checkbox from "../../../../../Components/Inputs/Checkbox";
|
||||||
import TextInput from "../../../../../Components/Inputs/TextInput";
|
import TextInput from "../../../../../Components/Inputs/TextInput";
|
||||||
import Select from "../../../../../Components/Inputs/Select";
|
import Search from "../../../../../Components/Inputs/Search";
|
||||||
import ImageUpload from "../../../../../Components/Inputs/ImageUpload";
|
import ImageUpload from "../../../../../Components/Inputs/ImageUpload";
|
||||||
import ColorPicker from "../../../../../Components/Inputs/ColorPicker";
|
import ColorPicker from "../../../../../Components/Inputs/ColorPicker";
|
||||||
import Progress from "../Progress";
|
import Progress from "../Progress";
|
||||||
@@ -14,6 +14,8 @@ import { useTheme } from "@emotion/react";
|
|||||||
import timezones from "../../../../../Utils/timezones.json";
|
import timezones from "../../../../../Utils/timezones.json";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
|
||||||
const TabSettings = ({
|
const TabSettings = ({
|
||||||
isCreate,
|
isCreate,
|
||||||
@@ -28,6 +30,7 @@ const TabSettings = ({
|
|||||||
// Utils
|
// Utils
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const [timezoneValue, setTimezoneValue] = useState("");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TabPanel value={tabValue}>
|
<TabPanel value={tabValue}>
|
||||||
@@ -101,13 +104,21 @@ const TabSettings = ({
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack gap={theme.spacing(6)}>
|
<Stack gap={theme.spacing(6)}>
|
||||||
<Select
|
<Search
|
||||||
id="timezone"
|
id="timezone"
|
||||||
name="timezone"
|
|
||||||
label={t("settingsDisplayTimezone")}
|
label={t("settingsDisplayTimezone")}
|
||||||
items={timezones}
|
options={timezones}
|
||||||
value={form.timezone}
|
filteredBy="name"
|
||||||
onChange={handleFormChange}
|
value={timezones.find((tz) => tz._id === form.timezone) || null}
|
||||||
|
inputValue={timezoneValue}
|
||||||
|
handleInputChange={(newVal) => setTimezoneValue(newVal)}
|
||||||
|
handleChange={(newValue) => {
|
||||||
|
setTimezoneValue("");
|
||||||
|
handleFormChange({
|
||||||
|
target: { name: "timezone", value: newValue?._id || "" },
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
isAdorned={false}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</ConfigBox>
|
</ConfigBox>
|
||||||
|
|||||||
Reference in new issue
Block a user