responsive design and bug fixes
This commit is contained in:
@@ -45,3 +45,7 @@ export const timeRanges = [
|
||||
{ range: 180, title: '6mo' },
|
||||
{ range: 365, title: '1y' },
|
||||
] as const;
|
||||
|
||||
export function isMinuteIntervalEnabledByRange(range: number) {
|
||||
return range === 0.3 || range === 0.6;
|
||||
}
|
||||
|
||||
6
apps/web/src/utils/getters.ts
Normal file
6
apps/web/src/utils/getters.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { Profile } from '@prisma/client';
|
||||
|
||||
export function getProfileName(profile: Profile | undefined | null) {
|
||||
if (!profile) return '';
|
||||
return [profile.first_name, profile.last_name].filter(Boolean).join(' ');
|
||||
}
|
||||
@@ -2,14 +2,16 @@ import resolveConfig from 'tailwindcss/resolveConfig';
|
||||
|
||||
import tailwinConfig from '../../tailwind.config';
|
||||
|
||||
const config = resolveConfig<any>(tailwinConfig);
|
||||
export const resolvedTailwindConfig = resolveConfig(tailwinConfig);
|
||||
|
||||
export const theme = config.theme;
|
||||
export const theme = resolvedTailwindConfig.theme;
|
||||
|
||||
export function getChartColor(index: number): string {
|
||||
const chartColors: string[] = Object.keys(theme.colors ?? {})
|
||||
const colors = theme?.colors ?? {};
|
||||
const chartColors: string[] = Object.keys(colors)
|
||||
.filter((key) => key.startsWith('chart-'))
|
||||
.map((key) => theme.colors[key] as string);
|
||||
.map((key) => colors[key])
|
||||
.filter((item): item is string => typeof item === 'string');
|
||||
|
||||
return chartColors[index % chartColors.length]!;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user