fix: calendar current day for light theme

This commit is contained in:
Darkham42
2022-06-11 23:22:58 +02:00
parent a5c4f30f57
commit 8d645ca404

View File

@@ -1,5 +1,5 @@
/* eslint-disable react/no-children-prop */
import { Box, Divider, Indicator, Popover, ScrollArea, createStyles } from '@mantine/core';
import { Box, Divider, Indicator, Popover, ScrollArea, createStyles, useMantineColorScheme } from '@mantine/core';
import React, { useEffect, useState } from 'react';
import { Calendar } from '@mantine/dates';
import { IconCalendar as CalendarIcon } from '@tabler/icons';
@@ -25,6 +25,7 @@ export const CalendarModule: IModule = {
export default function CalendarComponent(props: any) {
const { config } = useConfig();
const { colorScheme } = useMantineColorScheme();
const { secondaryColor } = useColorTheme();
const useStyles = createStyles(() => ({
weekend: {
@@ -99,8 +100,8 @@ export default function CalendarComponent(props: any) {
onChange={(day: any) => {}}
dayStyle={(date) =>
date.getDay() === today.getDay() && date.getDate() === today.getDate()
? { backgroundColor: '#2C2E33' }
: null
? { backgroundColor: colorScheme === 'dark' ? '#2C2E33' : '#f8f9fa' }
: {}
}
dayClassName={(date, modifiers) =>
cx({ [classes.weekend]: modifiers.weekend })