From 985be16f2df3cb34e1d69b9bacc662b64b840159 Mon Sep 17 00:00:00 2001 From: Miro Date: Thu, 7 Nov 2024 23:36:58 +0200 Subject: [PATCH] update responsive statistics --- .../DashboardPage/DashboardPage.module.css | 1 + src/Pages/Statistics/Statistics.module.css | 20 +++++++++++- src/components/Chart/Chart.jsx | 3 +- src/components/Chart/Chart.module.css | 21 +++++++++++++ src/components/Chart/Chart.modules.css | 1 - .../CustomDropdown/CustomDropdown.module.css | 6 ++++ .../DashboardComponent.modules.css | 4 +-- .../StatisticsDashboard.jsx | 3 +- .../StatisticsDashboard.module.css | 31 ++++--------------- .../StatisticsTable.module.css | 3 ++ 10 files changed, 62 insertions(+), 31 deletions(-) create mode 100644 src/components/Chart/Chart.module.css delete mode 100644 src/components/Chart/Chart.modules.css diff --git a/src/Pages/DashboardPage/DashboardPage.module.css b/src/Pages/DashboardPage/DashboardPage.module.css index 5c2c7d7..9f85ff6 100644 --- a/src/Pages/DashboardPage/DashboardPage.module.css +++ b/src/Pages/DashboardPage/DashboardPage.module.css @@ -21,6 +21,7 @@ min-height: calc(100dvh - 104px); padding-left: 32px; padding-right: 32px; + overflow: auto; } .sharedSectionElements { diff --git a/src/Pages/Statistics/Statistics.module.css b/src/Pages/Statistics/Statistics.module.css index 300b5e5..e5834f4 100644 --- a/src/Pages/Statistics/Statistics.module.css +++ b/src/Pages/Statistics/Statistics.module.css @@ -24,4 +24,22 @@ top: 7em; display: flex; gap: 3em; -} \ No newline at end of file +} + +@media screen and (max-width: 1280px) { + .staticAll { + position: relative; + gap: 4em; + justify-content: center; + width: 100vw; + } +} + +@media screen and (max-width: 768px) { + .staticAll { + position: relative; + flex-direction: column; + align-items: center; + top: 40px; + } +} diff --git a/src/components/Chart/Chart.jsx b/src/components/Chart/Chart.jsx index 8e60e71..45cf75c 100644 --- a/src/components/Chart/Chart.jsx +++ b/src/components/Chart/Chart.jsx @@ -6,6 +6,7 @@ import { Doughnut } from 'react-chartjs-2'; import { Chart as ChartJS, ArcElement, Tooltip, Legend } from 'chart.js'; import { selectExpensesByCategory } from '../../redux/selectors/transactionsSelector'; import { getUserInfo } from '../../redux/operations/authOperations'; +import styles from './Chart.module.css'; ChartJS.register(ArcElement, Tooltip, Legend); @@ -66,7 +67,7 @@ const Chart = () => { }; return ( -
+
{ const dispatch = useDispatch(); @@ -53,7 +54,7 @@ const StatisticsDashboard = () => { }; return ( -
+