From 613bdb39117218f88947428ed3c6f3cc88e90a2d Mon Sep 17 00:00:00 2001 From: Guillaume Bourdat Date: Thu, 23 Jan 2025 15:34:45 +0100 Subject: [PATCH] #273 custom links on parahraph --- web/src/ui/config-ui.json | 6 +++ web/src/ui/pages/home/Home.tsx | 73 +++++++++++----------------------- 2 files changed, 30 insertions(+), 49 deletions(-) diff --git a/web/src/ui/config-ui.json b/web/src/ui/config-ui.json index 7454d4db..c917695c 100644 --- a/web/src/ui/config-ui.json +++ b/web/src/ui/config-ui.json @@ -32,6 +32,12 @@ "softwareSelection": { "enabled": true }, + "theSillInAFewWordsParagraphLinks": [ + "https://fr.wikipedia.org/wiki/Logiciel_libre", + "https://www.legifrance.gouv.fr/jorf/article_jo/JORFARTI000033203039", + "https://code.gouv.fr/sill/readme", + "https://code.gouv.fr/fr/doc/licences-libres-dinum" + ], "statistics": { "catgegories": [ "softwareCount", diff --git a/web/src/ui/pages/home/Home.tsx b/web/src/ui/pages/home/Home.tsx index 96ae9c67..8810754a 100644 --- a/web/src/ui/pages/home/Home.tsx +++ b/web/src/ui/pages/home/Home.tsx @@ -237,7 +237,9 @@ export default function Home(props: Props) { string, JSX.Element > = {}; + obj[key] = ( + /* eslint-disable-next-line jsx-a11y/anchor-has-content */ + /> ); return Object.assign(map, obj); }, @@ -351,15 +353,6 @@ const useStyles = tss.withName({ Home }).create({ }, "helpUsBackground": { "backgroundColor": fr.colors.decisions.background.default.grey.hover - }, - "helpUsCards": { - "display": "grid", - "gridTemplateColumns": "repeat(3, 1fr)", - "columnGap": fr.spacing("6v"), - [fr.breakpoints.down("md")]: { - "gridTemplateColumns": `repeat(1, 1fr)`, - "rowGap": fr.spacing("4v") - } } }); @@ -458,45 +451,27 @@ const { WhatIsTheSillSection } = (() => { components={ { space: , - a1: ( - - ), - a2: ( - - ), - a3: ( - - ), - a4: ( - + ...config.home.theSillInAFewWordsParagraphLinks.reduce( + ( + map: Record, + link: string, + index: number + ) => { + const key = `a${index + 1}`; + const obj: Record = {}; + obj[key] = ( + + ); + return Object.assign(map, obj); + }, + {} ) } /* eslint-enable jsx-a11y/anchor-has-content */