From 1b03c8b78288e8c665eaaa250056ceacb18702b6 Mon Sep 17 00:00:00 2001 From: William Lima Date: Tue, 12 Dec 2023 22:55:51 -0100 Subject: [PATCH 1/4] #139 fix dataset rwd issues --- components/resource/About.tsx | 2 +- components/resource/NavBreadCrumbs.tsx | 10 ++-- components/resource/ResourceExplorer.tsx | 2 +- components/search/FiltersBar.tsx | 46 ++++++++++--------- components/search/NewForm.tsx | 6 +-- components/search/filters/FilterCarousel.tsx | 4 +- .../search/filters/TopicFilterCarousel.tsx | 23 ++++------ pages/[org]/[dataset]/r/[resource]/index.tsx | 4 +- pages/search.tsx | 2 +- styles/globals.css | 2 +- 10 files changed, 50 insertions(+), 51 deletions(-) diff --git a/components/resource/About.tsx b/components/resource/About.tsx index 2467f76..63aff74 100644 --- a/components/resource/About.tsx +++ b/components/resource/About.tsx @@ -38,7 +38,7 @@ const About: React.FC<{ variables: any }> = ({ variables }) => { return ( <>
-
+
{resource.format === 'CSV' ? (
-
    +
    1. - + {t('datasets')}
    2. - + {navInfo.orgTitle}
    3. - + {navInfo.datasetTitle} >
    4. -
    5. {navInfo.resourceTitle}
    6. +
    7. {navInfo.resourceTitle}
diff --git a/components/resource/ResourceExplorer.tsx b/components/resource/ResourceExplorer.tsx index e57212f..02ebda4 100644 --- a/components/resource/ResourceExplorer.tsx +++ b/components/resource/ResourceExplorer.tsx @@ -109,7 +109,7 @@ const DataExplorer: React.FC<{ dataset: any; columnHeaderStyle: any }> = ({ return (
{/* Preview: show Data Explorer if tabular data + datastore active */} -
+
diff --git a/components/search/FiltersBar.tsx b/components/search/FiltersBar.tsx index d4fbebe..dc0c93f 100644 --- a/components/search/FiltersBar.tsx +++ b/components/search/FiltersBar.tsx @@ -261,11 +261,11 @@ export default function FiltersBar({ sideFilter.organization.forEach((el) => fixTranslations(el)); return ( -
+
{filters === t('topics') && ( <> -
-
+
+
-
+
@@ -336,7 +336,7 @@ export default function FiltersBar({ )} {filters === t('organization') && ( -
+
@@ -392,26 +392,28 @@ export default function FiltersBar({ )} {filters === t('ds-bt-time') && ( -
- {Object.keys(timeFrames).map((timeframe, index) => ( - - ))} +
+
+ {Object.keys(timeFrames).map((timeframe, index) => ( + + ))} +
)} {currentTimeIndex === 0 && filters === t('ds-bt-time') && ( -
-
+
+
0 || sideFilter.organization.length > 0) && ( -
+
{t('active-filters')} {sideFilter.groups.length > 0 && (
diff --git a/components/search/NewForm.tsx b/components/search/NewForm.tsx index ea485b6..1655efa 100644 --- a/components/search/NewForm.tsx +++ b/components/search/NewForm.tsx @@ -54,7 +54,7 @@ const SearchForm: React.FC<{

{t('ds-h-sear')}

-
+
e.preventDefault()} @@ -77,7 +77,7 @@ const SearchForm: React.FC<{

{t('ds-p-filt')}

-
+
-
+
= ({ onSwiper={(instance) => setSwiper(instance)} breakpoints={{ 1: { - slidesPerView: 3, - slidesPerGroup: 3, + slidesPerView: 2, + slidesPerGroup: 2, }, 460: { slidesPerView: 3, diff --git a/components/search/filters/TopicFilterCarousel.tsx b/components/search/filters/TopicFilterCarousel.tsx index 9bb3d55..447536f 100644 --- a/components/search/filters/TopicFilterCarousel.tsx +++ b/components/search/filters/TopicFilterCarousel.tsx @@ -34,16 +34,16 @@ const TopicFilterCarousel: React.FC = ({ return ( <> -
+
-
+
= ({ onSwiper={(instance) => setSwiper(instance)} breakpoints={{ 1: { + slidesPerView: 1, + slidesPerGroup: 1, + }, + 460: { slidesPerView: 2, slidesPerGroup: 2, }, - 460: { + 720: { slidesPerView: 3, slidesPerGroup: 3, }, - 720: { - slidesPerView: 5, - slidesPerGroup: 5, - }, 1200: { - slidesPerView: 5, - slidesPerGroup: 5, + slidesPerView: 4, + slidesPerGroup: 4, }, 1280: { slidesPerView: 6, diff --git a/pages/[org]/index.tsx b/pages/[org]/index.tsx index 76fb762..a8c7d96 100644 --- a/pages/[org]/index.tsx +++ b/pages/[org]/index.tsx @@ -72,7 +72,7 @@ const Organization: React.FC = ({ variables }) => { {`${t('organization')} | ${t('title')}`} -
+
= ({ variables }) => { }} />
-
+

{amount}{' '} @@ -103,7 +103,7 @@ const Search: React.FC = ({ variables }) => { />

-
+
Date: Wed, 13 Dec 2023 14:54:50 -0100 Subject: [PATCH 3/4] #139 fix ts build errors --- components/home/NavTemplate.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/home/NavTemplate.tsx b/components/home/NavTemplate.tsx index d7bf544..9d39a87 100644 --- a/components/home/NavTemplate.tsx +++ b/components/home/NavTemplate.tsx @@ -9,7 +9,7 @@ const languages = ['ar', 'en']; const NavBar: React.FC<{ menu: any; logo: string }> = ({ menu, logo }) => { const router = useRouter(); - const navRef = useRef(); + const navRef = useRef(null); const [iseMenuScrollable, setIsMenuScrollable] = useState(false); function handleLocale(e: MouseEvent) { @@ -19,7 +19,7 @@ const NavBar: React.FC<{ menu: any; logo: string }> = ({ menu, logo }) => { } function checkScrollableMenu() { - const navbar = navRef.current; + const navbar: HTMLDivElement = navRef.current; if (navbar) setIsMenuScrollable(navbar.scrollWidth > navbar.offsetWidth); } From 11faee0dd1b1bd06f8dbe2addb7dc1a9a466612f Mon Sep 17 00:00:00 2001 From: Demenech Date: Wed, 13 Dec 2023 12:59:26 -0300 Subject: [PATCH 4/4] build: fix linting error --- components/_shared/ScrollIndicator.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/_shared/ScrollIndicator.tsx b/components/_shared/ScrollIndicator.tsx index 38f9d1e..e6e703f 100644 --- a/components/_shared/ScrollIndicator.tsx +++ b/components/_shared/ScrollIndicator.tsx @@ -64,6 +64,7 @@ const ScrollIndicator: React.FC<{
{stops.map((stop, index) => (