💄 Fix Calendar widget UI

This commit is contained in:
ajnart
2023-01-19 11:13:47 +09:00
parent 0dc8f24306
commit 6477b76bac

View File

@@ -45,7 +45,7 @@ interface CalendarTileProps {
}
function CalendarTile({ widget }: CalendarTileProps) {
const { secondaryColor } = useColorTheme();
const { secondaryColor, primaryColor } = useColorTheme();
const { name: configName } = useConfigContext();
const { classes, cx } = useStyles(secondaryColor);
const { colorScheme, colors } = useMantineTheme();
@@ -66,26 +66,29 @@ function CalendarTile({ widget }: CalendarTileProps) {
return (
<Group grow style={{ height: '100%' }}>
<Calendar
m={0}
p={0}
month={month}
// Should be offset 5px to the left
style={{ position: 'relative', top: -10 }}
style={{ position: 'relative', top: -15 }}
onMonthChange={setMonth}
size="xs"
fullWidth
onChange={() => {}}
firstDayOfWeek={widget.properties.sundayStart ? 'sunday' : 'monday'}
dayStyle={(date) => ({
margin: 1,
margin: 0,
backgroundColor: isToday(date)
? colorScheme === 'dark'
? colors.dark[5]
: colors.gray[0]
: undefined,
})}
hideWeekdays
styles={{
calendarHeader: {
marginRight: 40,
marginLeft: 40,
margin: 0,
padding: 0,
},
}}
allowLevelChange={false}