From fb225934fcd37d3a72e711a8b7ac768e8ed7c01e Mon Sep 17 00:00:00 2001 From: Thomas Catinaud Taris Date: Wed, 15 May 2024 14:21:39 +0200 Subject: [PATCH 1/4] feat: prepare component --- src/components/Summary.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Summary.tsx b/src/components/Summary.tsx index f23cde843..2bb7f2823 100644 --- a/src/components/Summary.tsx +++ b/src/components/Summary.tsx @@ -21,7 +21,10 @@ const Summary = ({ } return ( -
+
+ ); }; export default Summary; From c6aa2fa84597bddf5adfcd2fc09495de3b571320 Mon Sep 17 00:00:00 2001 From: Thomas Catinaud Taris Date: Wed, 15 May 2024 14:21:39 +0200 Subject: [PATCH 2/4] feat: prepare component --- src/components/Summary.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Summary.tsx b/src/components/Summary.tsx index f23cde843..2bb7f2823 100644 --- a/src/components/Summary.tsx +++ b/src/components/Summary.tsx @@ -21,7 +21,10 @@ const Summary = ({ } return ( -
+
+ ); }; export default Summary; From e5601e213ff39bc9aded9d624e296ce6c731988d Mon Sep 17 00:00:00 2001 From: Thomas Catinaud Taris Date: Wed, 22 May 2024 14:18:23 +0200 Subject: [PATCH 3/4] feat: update summary links --- public/images/bottom-dark.svg | 3 ++ src/app/dashboard/page.tsx | 8 ++++ src/app/layout.tsx | 6 ++- src/components/IntroBlock.tsx | 6 +-- src/components/Summary.tsx | 90 +++++++++++++++++++++++++---------- 5 files changed, 85 insertions(+), 28 deletions(-) create mode 100644 public/images/bottom-dark.svg diff --git a/public/images/bottom-dark.svg b/public/images/bottom-dark.svg new file mode 100644 index 000000000..e118cba83 --- /dev/null +++ b/public/images/bottom-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 5a0c62744..e5e9da28a 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -20,6 +20,7 @@ const DashboardChart = dynamic(() => import("@/components/DashboardChart"), { const summary: SummaryLinksProps = [ { + id: "intro", title: "Intro", sublinks: [ { @@ -41,6 +42,7 @@ const summary: SummaryLinksProps = [ ], }, { + id: "company", title: "Entreprises", sublinks: [ { @@ -62,6 +64,7 @@ const summary: SummaryLinksProps = [ ], }, { + id: "biondiversity", title: "BiodiversitĂ©", sublinks: [ { @@ -75,6 +78,7 @@ const summary: SummaryLinksProps = [ ], }, { + id: "health", title: "Human health", sublinks: [ { @@ -88,6 +92,7 @@ const summary: SummaryLinksProps = [ ], }, { + id: "animals", title: "Bien ĂȘtre animal", sublinks: [ { @@ -101,6 +106,7 @@ const summary: SummaryLinksProps = [ ], }, { + id: "climate", title: "Climat", sublinks: [ { @@ -110,6 +116,7 @@ const summary: SummaryLinksProps = [ ], }, { + id: "social", title: "Social", sublinks: [ { @@ -119,6 +126,7 @@ const summary: SummaryLinksProps = [ ], }, { + id: "alternative", title: "Alternatives", sublinks: [ { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 67a9190ac..5acea8103 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,3 +1,4 @@ +import clsx from "clsx"; import { Metadata } from "next"; import { Barlow_Condensed, Montserrat } from "next/font/google"; import * as React from "react"; @@ -60,7 +61,10 @@ export default function RootLayout({ children: React.ReactNode; }) { return ( - +
{children}
diff --git a/src/components/IntroBlock.tsx b/src/components/IntroBlock.tsx index d8c04cf0c..e1e2f8074 100644 --- a/src/components/IntroBlock.tsx +++ b/src/components/IntroBlock.tsx @@ -19,11 +19,11 @@ const IntroBlock = ({
-
+
{image && ( { + const [openMenu, setOpenMenu] = useState(""); + const handleClickLink = ( + e: React.MouseEvent, + id: string, + ) => { + e.preventDefault(); + setOpenMenu(openMenu === id ? "" : id); + }; + if (!links) { return <>; } return ( ); }; From a3e06526e90a50a822b5096d25567f6238d75e96 Mon Sep 17 00:00:00 2001 From: Thomas Catinaud Taris Date: Wed, 22 May 2024 14:20:05 +0200 Subject: [PATCH 4/4] fix: build --- src/components/Summary.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Summary.tsx b/src/components/Summary.tsx index dc29095c1..a4adc76b0 100644 --- a/src/components/Summary.tsx +++ b/src/components/Summary.tsx @@ -1,6 +1,6 @@ import clsx from "clsx"; -import React, { useState } from "react"; import Image from "next/image"; +import React, { useState } from "react"; export type SummaryLinksProps = { id: string; @@ -77,7 +77,7 @@ const Summary = ({ href={`#${sublink.targetId}`} role="menuitem" className="block p-2 hover:text-red1" - onClick={(e) => { + onClick={() => { setOpenMenu(""); }} >