[#64] fixed css and empty name bug

This commit is contained in:
Camille Moussu
2025-09-12 09:31:34 +02:00
committed by Benoit TELLIER
parent b6f8097769
commit 2a84eba84b
3 changed files with 17 additions and 21 deletions
+3
View File
@@ -11,6 +11,9 @@ main {
.calendarListHeader {
padding-top: 10px;
display: flex;
align-items: center;
margin-left: 25%;
}
.sidebar {
border-right: 2px gray;
@@ -28,7 +28,6 @@ export default function CalendarSelection({
);
};
useEffect(() => {}, [calendars]);
const [anchorElCal, setAnchorElCal] = useState<HTMLElement | null>(null);
return (
+14 -20
View File
@@ -26,18 +26,18 @@ function CalendarPopover({
const [name, setName] = useState("");
const [description, setDescription] = useState("");
const [color, setColor] = useState("");
const [timeZone, setTimeZone] = useState("");
const timezones = Intl.supportedValuesOf?.("timeZone") ?? [];
const handleSave = () => {
const calId = crypto.randomUUID();
dispatch(
createCalendarAsync({ name, desc: description, color, userId, calId })
);
onClose({}, "backdropClick");
if (name) {
dispatch(
createCalendarAsync({ name, desc: description, color, userId, calId })
);
onClose({}, "backdropClick");
// Reset
setName("");
setDescription("");
// Reset
setName("");
setDescription("");
}
};
const palette = [
"#D50000",
@@ -100,16 +100,6 @@ function CalendarPopover({
/>
))}
</ButtonGroup>
<Select
fullWidth
label="timeZone"
value={timeZone}
onChange={(e) => setTimeZone(e.target.value)}
>
{timezones.map((zone: string) => (
<div>{zone}</div>
))}
</Select>
<Box mt={2} display="flex" justifyContent="flex-end" gap={1}>
<Button
variant="outlined"
@@ -117,7 +107,11 @@ function CalendarPopover({
>
Cancel
</Button>
<Button variant="contained" onClick={handleSave}>
<Button
disabled={name && name !== "" ? false : true}
variant="contained"
onClick={handleSave}
>
Save
</Button>
</Box>