diff --git a/src/widgets/calendar/CalendarDay.tsx b/src/widgets/calendar/CalendarDay.tsx index 2d68be0da..9cd4734b5 100644 --- a/src/widgets/calendar/CalendarDay.tsx +++ b/src/widgets/calendar/CalendarDay.tsx @@ -1,4 +1,4 @@ -import { Container, Indicator, IndicatorProps, Popover, Center } from '@mantine/core'; +import { Container, Indicator, IndicatorProps, Popover, useMantineTheme, Button } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; import { MediaList } from './MediaList'; import { MediasType } from './type'; @@ -12,6 +12,7 @@ interface CalendarDayProps { export const CalendarDay = ({ date, medias, size }: CalendarDayProps) => { const [opened, { close, open }] = useDisclosure(false); + const { radius, fn } = useMantineTheme(); var indicatorSize = 10; var indicatorOffset = -4; switch(size){ @@ -54,18 +55,21 @@ export const CalendarDay = ({ date, medias, size }: CalendarDayProps) => { }} onClose={close} opened={opened} - sx={(theme : any) => ({ - padding:'18% !important', - height: '100%', - width: '100%', - borderRadius: (size!=="xs" && size!=="sm")?theme.radius.lg:theme.radius.md, - borderStyle: "solid", - borderWidth: "0.2rem", - borderColor: opened? theme.fn.primaryColor() : '#00000000', - })} > - + 0 ? open : undefined} + sx={{ root: { + padding:'18% !important', + height: '100%', + width: '100%', + alignContent: 'center', + borderRadius: ['xs','sm'].includes(size) ? radius.md : radius.lg, + borderStyle: "solid", + borderWidth: "0.2rem", + borderColor: opened ? fn.primaryColor() : 'transparent', + }}} + > @@ -77,7 +81,7 @@ export const CalendarDay = ({ date, medias, size }: CalendarDayProps) => { - + diff --git a/src/widgets/calendar/CalendarTile.tsx b/src/widgets/calendar/CalendarTile.tsx index b7591318b..67e93fada 100644 --- a/src/widgets/calendar/CalendarTile.tsx +++ b/src/widgets/calendar/CalendarTile.tsx @@ -91,7 +91,7 @@ function CalendarTile({ widget }: CalendarTileProps) { size={widget.properties.fontSize} locale={i18n?.resolvedLanguage ?? 'en'} firstDayOfWeek={widget.properties.sundayStart ? 0 : 1} - hideWeekdays={widget.properties.hideWeekDays ? true : false} + hideWeekdays={widget.properties.hideWeekDays} style={{ position: 'relative' }} date={month} maxLevel="month" @@ -129,7 +129,7 @@ function CalendarTile({ widget }: CalendarTileProps) { flex: 1, }, day:{ - borderRadius: (widget.properties.fontSize !== "xs" && widget.properties.fontSize!=="sm")? radius.lg:radius.md, + borderRadius: ['xs','sm'].includes(widget.properties.fontSize) ? radius.md : radius.lg, }, }} getDayProps={(date) => ({