From c1d3bebfb3dcfd964e811860f981a1f2ba296805 Mon Sep 17 00:00:00 2001 From: ajnart Date: Tue, 3 Jan 2023 22:30:52 +0900 Subject: [PATCH] Calendar widget styling --- src/widgets/calendar/CalendarTile.tsx | 64 ++++++++++++++------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/src/widgets/calendar/CalendarTile.tsx b/src/widgets/calendar/CalendarTile.tsx index 22c6cd480..f5ab105c1 100644 --- a/src/widgets/calendar/CalendarTile.tsx +++ b/src/widgets/calendar/CalendarTile.tsx @@ -1,4 +1,4 @@ -import { Center, createStyles, MantineThemeColors, useMantineTheme } from '@mantine/core'; +import { createStyles, Group, MantineThemeColors, useMantineTheme } from '@mantine/core'; import { Calendar } from '@mantine/dates'; import { IconCalendarTime } from '@tabler/icons'; import { useQuery } from '@tanstack/react-query'; @@ -21,7 +21,7 @@ const definition = defineWidget({ }, }, gridstack: { - minWidth: 4, + minWidth: 3, minHeight: 5, maxWidth: 12, maxHeight: 12, @@ -55,35 +55,37 @@ function CalendarTile({ widget }: CalendarTileProps) { }); return ( - {}} - firstDayOfWeek={widget.properties.sundayStart ? 'sunday' : 'monday'} - dayStyle={(date) => ({ - margin: 1, - backgroundColor: isToday(date) - ? colorScheme === 'dark' - ? colors.dark[5] - : colors.gray[0] - : undefined, - })} - styles={{ - calendarHeader: { - marginRight: 40, - marginLeft: 40, - }, - }} - allowLevelChange={false} - dayClassName={(_, modifiers) => cx({ [classes.weekend]: modifiers.weekend })} - renderDay={(date) => ( - - )} - /> + + {}} + firstDayOfWeek={widget.properties.sundayStart ? 'sunday' : 'monday'} + dayStyle={(date) => ({ + margin: 1, + backgroundColor: isToday(date) + ? colorScheme === 'dark' + ? colors.dark[5] + : colors.gray[0] + : undefined, + })} + styles={{ + calendarHeader: { + marginRight: 40, + marginLeft: 40, + }, + }} + allowLevelChange={false} + dayClassName={(_, modifiers) => cx({ [classes.weekend]: modifiers.weekend })} + renderDay={(date) => ( + + )} + /> + ); }