mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 07:55:52 +01:00
fix: calendar current day for light theme
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable react/no-children-prop */
|
/* 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 React, { useEffect, useState } from 'react';
|
||||||
import { Calendar } from '@mantine/dates';
|
import { Calendar } from '@mantine/dates';
|
||||||
import { IconCalendar as CalendarIcon } from '@tabler/icons';
|
import { IconCalendar as CalendarIcon } from '@tabler/icons';
|
||||||
@@ -25,6 +25,7 @@ export const CalendarModule: IModule = {
|
|||||||
|
|
||||||
export default function CalendarComponent(props: any) {
|
export default function CalendarComponent(props: any) {
|
||||||
const { config } = useConfig();
|
const { config } = useConfig();
|
||||||
|
const { colorScheme } = useMantineColorScheme();
|
||||||
const { secondaryColor } = useColorTheme();
|
const { secondaryColor } = useColorTheme();
|
||||||
const useStyles = createStyles(() => ({
|
const useStyles = createStyles(() => ({
|
||||||
weekend: {
|
weekend: {
|
||||||
@@ -99,8 +100,8 @@ export default function CalendarComponent(props: any) {
|
|||||||
onChange={(day: any) => {}}
|
onChange={(day: any) => {}}
|
||||||
dayStyle={(date) =>
|
dayStyle={(date) =>
|
||||||
date.getDay() === today.getDay() && date.getDate() === today.getDate()
|
date.getDay() === today.getDay() && date.getDate() === today.getDate()
|
||||||
? { backgroundColor: '#2C2E33' }
|
? { backgroundColor: colorScheme === 'dark' ? '#2C2E33' : '#f8f9fa' }
|
||||||
: null
|
: {}
|
||||||
}
|
}
|
||||||
dayClassName={(date, modifiers) =>
|
dayClassName={(date, modifiers) =>
|
||||||
cx({ [classes.weekend]: modifiers.weekend })
|
cx({ [classes.weekend]: modifiers.weekend })
|
||||||
|
|||||||
Reference in New Issue
Block a user