From d9f4b6fc8c86e4234ec073fc3dbdd7c65c910715 Mon Sep 17 00:00:00 2001
From: Tsuni <78718829+TetraTsunami@users.noreply.github.com>
Date: Mon, 2 Dec 2024 20:30:13 -0600
Subject: [PATCH] [fix] Improve overflow on small screens
---
src/components/StatisticsFilterBar.tsx | 25 +++++++++++++++--------
src/components/filters/BaseFilter.tsx | 7 +++++--
src/components/filters/CategoryFilter.tsx | 4 ++--
src/components/filters/CountryFilter.tsx | 4 ++--
4 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/src/components/StatisticsFilterBar.tsx b/src/components/StatisticsFilterBar.tsx
index fea7b4e..1a0fef4 100644
--- a/src/components/StatisticsFilterBar.tsx
+++ b/src/components/StatisticsFilterBar.tsx
@@ -11,14 +11,23 @@ type statsFilterProps = {
const StatisticsFilterBar = ({ data, filters, dispatchFilters }: statsFilterProps) => {
return (
-
- {filters.map((filter) => {
- const FilterComponent = filter.component
- return (
-
- )
- })}
-
+
+
+ {filters.map((filter) => {
+ const FilterComponent = filter.component
+ return (
+
+ )
+ })}
+
+
)
}
diff --git a/src/components/filters/BaseFilter.tsx b/src/components/filters/BaseFilter.tsx
index 5f87bb2..8d6c78d 100644
--- a/src/components/filters/BaseFilter.tsx
+++ b/src/components/filters/BaseFilter.tsx
@@ -17,7 +17,7 @@ import {
/**
* Represents a filter chip that can be clicked to open a dropdown with more options. Handles the dropdown state and visibility.
*/
-const BaseFilter = ({ icon, text, children }: { icon: any; text: string; children: ReactNode }) => {
+const BaseFilter = ({ icon, text, children, scrollOverflow }: { icon: any; text: string; children: ReactNode; scrollOverflow?: boolean }) => {
const [isOpen, setIsOpen] = useState(false)
const arrowRef = useRef(null)
@@ -62,7 +62,10 @@ const BaseFilter = ({ icon, text, children }: { icon: any; text: string; childre
diff --git a/src/components/filters/CategoryFilter.tsx b/src/components/filters/CategoryFilter.tsx
index 4e8cf5b..b4aa961 100644
--- a/src/components/filters/CategoryFilter.tsx
+++ b/src/components/filters/CategoryFilter.tsx
@@ -87,12 +87,12 @@ const CategoryFilter = ({ id, data, dispatch }: filterProps) => {
}
return (
-
} text={'Categorías: ' + filterString.join(', ')}>
+
} text={'Categorías: ' + filterString.join(', ')} scrollOverflow={true}>
-