[#64] fixed css and empty name bug
This commit is contained in:
committed by
Benoit TELLIER
parent
b6f8097769
commit
2a84eba84b
@@ -11,6 +11,9 @@ main {
|
|||||||
|
|
||||||
.calendarListHeader {
|
.calendarListHeader {
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 25%;
|
||||||
}
|
}
|
||||||
.sidebar {
|
.sidebar {
|
||||||
border-right: 2px gray;
|
border-right: 2px gray;
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ export default function CalendarSelection({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {}, [calendars]);
|
|
||||||
const [anchorElCal, setAnchorElCal] = useState<HTMLElement | null>(null);
|
const [anchorElCal, setAnchorElCal] = useState<HTMLElement | null>(null);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -26,18 +26,18 @@ function CalendarPopover({
|
|||||||
const [name, setName] = useState("");
|
const [name, setName] = useState("");
|
||||||
const [description, setDescription] = useState("");
|
const [description, setDescription] = useState("");
|
||||||
const [color, setColor] = useState("");
|
const [color, setColor] = useState("");
|
||||||
const [timeZone, setTimeZone] = useState("");
|
|
||||||
const timezones = Intl.supportedValuesOf?.("timeZone") ?? [];
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
const calId = crypto.randomUUID();
|
const calId = crypto.randomUUID();
|
||||||
dispatch(
|
if (name) {
|
||||||
createCalendarAsync({ name, desc: description, color, userId, calId })
|
dispatch(
|
||||||
);
|
createCalendarAsync({ name, desc: description, color, userId, calId })
|
||||||
onClose({}, "backdropClick");
|
);
|
||||||
|
onClose({}, "backdropClick");
|
||||||
|
|
||||||
// Reset
|
// Reset
|
||||||
setName("");
|
setName("");
|
||||||
setDescription("");
|
setDescription("");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const palette = [
|
const palette = [
|
||||||
"#D50000",
|
"#D50000",
|
||||||
@@ -100,16 +100,6 @@ function CalendarPopover({
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</ButtonGroup>
|
</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}>
|
<Box mt={2} display="flex" justifyContent="flex-end" gap={1}>
|
||||||
<Button
|
<Button
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
@@ -117,7 +107,11 @@ function CalendarPopover({
|
|||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="contained" onClick={handleSave}>
|
<Button
|
||||||
|
disabled={name && name !== "" ? false : true}
|
||||||
|
variant="contained"
|
||||||
|
onClick={handleSave}
|
||||||
|
>
|
||||||
Save
|
Save
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
Reference in New Issue
Block a user