From 8dfb783d98fb4d38e54fdc0885597dd3eb190d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1rbara=20Chaves?= Date: Thu, 31 Oct 2024 16:20:49 +0100 Subject: [PATCH] Client/feature/mobile version (#76) * Mobile version --- client/src/app/layout-providers.tsx | 1 - .../components/map/layers/marker/index.tsx | 14 ++- client/src/components/map/legend/index.tsx | 7 +- client/src/components/ui/carousel/index.tsx | 6 +- .../src/components/ui/scroll-explanation.tsx | 2 +- .../src/containers/globe/categories/index.tsx | 3 +- client/src/containers/globe/filters/index.tsx | 22 ++-- client/src/containers/globe/index.tsx | 12 +- client/src/containers/header/index.tsx | 11 +- client/src/containers/home/index.tsx | 55 ++------- client/src/containers/map/index.tsx | 105 +++++++++++++----- .../map/markers/globe-markers/index.tsx | 26 ++++- .../markers/selected-stories-marker/index.tsx | 5 +- client/src/containers/story/header.tsx | 16 +-- .../story/steps/layouts/outro-step.tsx | 17 +-- client/src/hooks/map/index.ts | 31 ++++++ client/src/hooks/screen-size/index.ts | 34 +++--- client/src/lib/stories/index.ts | 2 + client/tailwind.config.js | 4 +- 19 files changed, 218 insertions(+), 155 deletions(-) diff --git a/client/src/app/layout-providers.tsx b/client/src/app/layout-providers.tsx index 958af46..c4d998f 100644 --- a/client/src/app/layout-providers.tsx +++ b/client/src/app/layout-providers.tsx @@ -5,7 +5,6 @@ import { PropsWithChildren, useState } from 'react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { TooltipProvider } from '@/components/ui/tooltip'; - import { notesESA, openSans } from '@/styles/fonts'; export default function Providers({ children }: PropsWithChildren) { diff --git a/client/src/components/map/layers/marker/index.tsx b/client/src/components/map/layers/marker/index.tsx index 5f6585e..3a9752c 100644 --- a/client/src/components/map/layers/marker/index.tsx +++ b/client/src/components/map/layers/marker/index.tsx @@ -1,11 +1,15 @@ +'use client'; + import { Marker as RMarker } from 'react-map-gl'; +import { XIcon } from 'lucide-react'; + import { cn } from '@/lib/classnames'; +import { useIsMobile } from '@/hooks/screen-size'; + import { Button } from '@/components/ui/button'; import CategoryIcon from '@/components/ui/category-icon'; -import { useBreakpoint } from '@/hooks/screen-size'; -import { XIcon } from 'lucide-react'; type MarkerProps = { markers?: (GeoJSON.Feature | null)[]; @@ -16,7 +20,7 @@ type MarkerProps = { const Marker = ({ markers, handleClick, handleClose }: MarkerProps) => { const { coordinates } = markers?.[0]?.geometry || {}; - const isMobile = !useBreakpoint()('sm'); + const isMobile = useIsMobile(); if (!coordinates?.length) return null; @@ -55,9 +59,9 @@ const Marker = ({ markers, handleClick, handleClose }: MarkerProps) => { />

{marker?.properties?.categoryName}