From e1718072e8528fbeaf0e2ecb06d75038783da51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1rbara=20Chaves?= Date: Thu, 31 Oct 2024 16:32:28 +0100 Subject: [PATCH] Fix landing to globe pages unwanted navigation --- client/src/components/map/legend/item/index.tsx | 1 - client/src/containers/globe/filters/index.tsx | 2 +- client/src/containers/map/index.tsx | 5 ++++- client/src/lib/stories/index.ts | 2 -- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/components/map/legend/item/index.tsx b/client/src/components/map/legend/item/index.tsx index b9e3d5b..ce0a371 100644 --- a/client/src/components/map/legend/item/index.tsx +++ b/client/src/components/map/legend/item/index.tsx @@ -12,7 +12,6 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/component import LegendItemToolbar from './toolbar'; export const LegendItem: React.FC = ({ - id, children, name, className = '', diff --git a/client/src/containers/globe/filters/index.tsx b/client/src/containers/globe/filters/index.tsx index 74d5047..2f0ca76 100644 --- a/client/src/containers/globe/filters/index.tsx +++ b/client/src/containers/globe/filters/index.tsx @@ -130,7 +130,7 @@ const Filters = ({ filtersActive }: FiltersProps) => {
- {categoriesData?.data?.map(({ id, attributes }) => { + {categoriesData?.data?.map(({ attributes }) => { if (attributes?.name && attributes?.slug) { return ( (null); const containerRef = useRef(null); + const isMobile = useIsMobile(); const { scrollYProgress } = useScroll({ target: targetRef, @@ -131,7 +134,7 @@ export default function MapContainer() { }); useMotionValueEvent(scrollYProgress, 'change', (v) => { - if (isLandingPage && v > 0.9) { + if (isLandingPage && isMobile && v > 0.9) { router.push('/globe'); } }); diff --git a/client/src/lib/stories/index.ts b/client/src/lib/stories/index.ts index ce3c48f..9b2b888 100644 --- a/client/src/lib/stories/index.ts +++ b/client/src/lib/stories/index.ts @@ -1,5 +1,3 @@ -import { MapRef } from 'react-map-gl'; - import { GetCategoriesParams } from '@/types/generated/strapi.schemas'; export const getStoriesParams = (params?: {