Calendar sidebar: padding via MUI, sticky Create Event button; DateCalendar width 100%; Create button full width (#227)
This commit is contained in:
@@ -27,6 +27,7 @@ import { createSelector } from "@reduxjs/toolkit";
|
|||||||
import AddIcon from "@mui/icons-material/Add";
|
import AddIcon from "@mui/icons-material/Add";
|
||||||
import { TempCalendarsInput } from "./TempCalendarsInput";
|
import { TempCalendarsInput } from "./TempCalendarsInput";
|
||||||
import Button from "@mui/material/Button";
|
import Button from "@mui/material/Button";
|
||||||
|
import { Box } from "@mui/material";
|
||||||
import {
|
import {
|
||||||
updateSlotLabelVisibility,
|
updateSlotLabelVisibility,
|
||||||
eventToFullCalendarFormat,
|
eventToFullCalendarFormat,
|
||||||
@@ -263,15 +264,33 @@ export default function CalendarApp({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<main className="main-layout">
|
<main className="main-layout">
|
||||||
<div className="sidebar">
|
<Box
|
||||||
<Button
|
className="sidebar"
|
||||||
variant="contained"
|
sx={{
|
||||||
onClick={() =>
|
padding: "0 25px 16px",
|
||||||
eventHandlers.handleDateSelect(null as unknown as DateSelectArg)
|
position: "relative",
|
||||||
}
|
}}
|
||||||
|
>
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
position: "sticky",
|
||||||
|
top: 0,
|
||||||
|
zIndex: 10,
|
||||||
|
backgroundColor: "#fff",
|
||||||
|
paddingTop: "16px",
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<AddIcon /> <p>Create Event</p>
|
<Button
|
||||||
</Button>
|
size="large"
|
||||||
|
variant="contained"
|
||||||
|
fullWidth
|
||||||
|
onClick={() =>
|
||||||
|
eventHandlers.handleDateSelect(null as unknown as DateSelectArg)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<AddIcon /> <p>Create Event</p>
|
||||||
|
</Button>
|
||||||
|
</Box>
|
||||||
|
|
||||||
<MiniCalendar
|
<MiniCalendar
|
||||||
calendarRef={calendarRef}
|
calendarRef={calendarRef}
|
||||||
@@ -292,7 +311,7 @@ export default function CalendarApp({
|
|||||||
setSelectedCalendars={setSelectedCalendars}
|
setSelectedCalendars={setSelectedCalendars}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Box>
|
||||||
<div className="calendar">
|
<div className="calendar">
|
||||||
<ImportAlert />
|
<ImportAlert />
|
||||||
<FullCalendar
|
<FullCalendar
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ export function MiniCalendar({
|
|||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
views={["month", "day"]}
|
views={["month", "day"]}
|
||||||
|
sx={{ width: "100%" }}
|
||||||
slotProps={{
|
slotProps={{
|
||||||
day: (ownerState) => {
|
day: (ownerState) => {
|
||||||
const date = ownerState.day.toDate();
|
const date = ownerState.day.toDate();
|
||||||
|
|||||||
Reference in New Issue
Block a user