fix(calendar): remove scrollbar for 2x2 (#3227)

This commit is contained in:
Meier Lukas
2025-05-26 11:40:42 +02:00
committed by GitHub
parent d4ef212042
commit 1d27da2230
2 changed files with 13 additions and 6 deletions

View File

@@ -44,8 +44,8 @@ export const CalendarDay = ({ date, events, disabled, rootHeight, rootWidth }: C
h="100%" h="100%"
w="100%" w="100%"
p={0} p={0}
pt={isSmall ? 5 : 20} pt={isSmall ? 0 : 10}
pb={isSmall ? 5 : 20} pb={isSmall ? 0 : 10}
m={0} m={0}
bd={`2px solid ${opened && !disabled ? primaryColor : "transparent"}`} bd={`2px solid ${opened && !disabled ? primaryColor : "transparent"}`}
style={{ style={{

View File

@@ -68,6 +68,7 @@ const CalendarBase = ({ isEditMode, events, month, setMonth, options }: Calendar
const mantineTheme = useMantineTheme(); const mantineTheme = useMantineTheme();
const actualItemRadius = mantineTheme.radius[board.itemRadius]; const actualItemRadius = mantineTheme.radius[board.itemRadius];
const { ref, width, height } = useElementSize(); const { ref, width, height } = useElementSize();
const isSmall = width < 256;
return ( return (
<Calendar <Calendar
@@ -82,16 +83,20 @@ const CalendarBase = ({ isEditMode, events, month, setMonth, options }: Calendar
firstDayOfWeek={firstDayOfWeek} firstDayOfWeek={firstDayOfWeek}
static={isEditMode} static={isEditMode}
className={classes.calendar} className={classes.calendar}
w={"100%"} w="100%"
h={"100%"} h="100%"
ref={ref} ref={ref}
styles={{ styles={{
calendarHeaderControl: { calendarHeaderControl: {
pointerEvents: isEditMode ? "none" : undefined, pointerEvents: isEditMode ? "none" : undefined,
borderRadius: "md", borderRadius: "md",
height: isSmall ? "1.5rem" : undefined,
width: isSmall ? "1.5rem" : undefined,
}, },
calendarHeaderLevel: { calendarHeaderLevel: {
pointerEvents: "none", pointerEvents: "none",
fontSize: isSmall ? "0.75rem" : undefined,
height: "100%",
}, },
levelsGroup: { levelsGroup: {
height: "100%", height: "100%",
@@ -107,10 +112,12 @@ const CalendarBase = ({ isEditMode, events, month, setMonth, options }: Calendar
day: { day: {
borderRadius: actualItemRadius, borderRadius: actualItemRadius,
width: "100%", width: "100%",
height: "auto", height: "100%",
position: "relative", position: "relative",
}, },
month: {}, month: {
height: "100%",
},
weekday: { weekday: {
padding: 0, padding: 0,
}, },