diff --git a/frontend/index.html b/frontend/index.html index efdac18..48e510c 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -3,6 +3,7 @@ + Семейный бюджет diff --git a/frontend/src/components/CategoryChart.tsx b/frontend/src/components/CategoryChart.tsx index 9d65e5c..7d532ed 100644 --- a/frontend/src/components/CategoryChart.tsx +++ b/frontend/src/components/CategoryChart.tsx @@ -7,6 +7,7 @@ import { } from 'recharts'; import type { ByCategoryItem } from '@family-budget/shared'; import { formatAmount } from '../utils/format'; +import { useMediaQuery } from '../hooks/useMediaQuery'; interface Props { data: ByCategoryItem[]; @@ -25,6 +26,9 @@ const rubFormatter = new Intl.NumberFormat('ru-RU', { }); export function CategoryChart({ data }: Props) { + const isMobile = useMediaQuery('(max-width: 600px)'); + const chartHeight = isMobile ? 250 : 300; + if (data.length === 0) { return
Нет данных за период
; } @@ -38,7 +42,7 @@ export function CategoryChart({ data }: Props) { return (
- + setDrawerOpen(false); return (
-