From 3f514431d631cdc40dbcae9bf50440fd440e1161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Gonz=C3=A1lez=20Mu=C3=B1oz?= Date: Fri, 4 Oct 2024 12:49:36 +0200 Subject: [PATCH] fixes home accordion --- src/containers/home/thematic-areas/index.tsx | 112 +++++-------------- 1 file changed, 30 insertions(+), 82 deletions(-) diff --git a/src/containers/home/thematic-areas/index.tsx b/src/containers/home/thematic-areas/index.tsx index c6f3efa..9cd00b4 100644 --- a/src/containers/home/thematic-areas/index.tsx +++ b/src/containers/home/thematic-areas/index.tsx @@ -69,90 +69,38 @@ const THEMATIC_AREAS = [ ]; export default function ThematicAreas() { - const [openAccordionItem, setOpenAccordionItem] = useState(null); const [currentAccordionItem, setCurrentAccordionItem] = useState(null); return ( - <> - -
-
-

Thematic areas

-

- The more4nature activities are focused on three key thematic areas in environmental - protection: -

-
+ +
+
+

Thematic areas

+

+ The more4nature activities are focused on three key thematic areas in environmental + protection: +

- -
    - {THEMATIC_AREAS.map(({ name, description, imageURL, icon }) => ( -
  • -
    -
    - {icon} - {name} -
    -

    {description}

    -
  • - ))} -
-
- - setOpenAccordionItem(v || null)} - > - {THEMATIC_AREAS.map(({ name, description, imageURL, icon }) => { - const isFadedAccordionItem = openAccordionItem && name !== openAccordionItem; - const isOpenAccordionItem = openAccordionItem && name === openAccordionItem; - return ( -
- - -
- {icon} - {name} -
-
- {description} -
-
-
- ); - })} - - - +
+ +
    + {THEMATIC_AREAS.map(({ name, description, imageURL, icon }) => ( +
  • +
    +
    + {icon} + {name} +
    +

    {description}

    +
  • + ))} +
+
- + ); }