From e5601e213ff39bc9aded9d624e296ce6c731988d Mon Sep 17 00:00:00 2001 From: Thomas Catinaud Taris Date: Wed, 22 May 2024 14:18:23 +0200 Subject: [PATCH] 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 ( ); };