🐛 Fix calendar sizing (#852)
This commit is contained in:
16
src/widgets/calendar/bg-calculator.ts
Normal file
16
src/widgets/calendar/bg-calculator.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ColorScheme, useMantineTheme } from '@mantine/core';
|
||||
import { isToday } from '../../tools/shared/time/date.tool';
|
||||
|
||||
export const getBgColorByDateAndTheme = (colorScheme: ColorScheme, date: Date) => {
|
||||
if (!isToday(date)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const { colors } = useMantineTheme();
|
||||
|
||||
if (colorScheme === 'dark') {
|
||||
return colors.dark[5];
|
||||
}
|
||||
|
||||
return colors.gray[2];
|
||||
};
|
||||
Reference in New Issue
Block a user