From 07d3c458f82d250a877691d019204b3a481bc74b Mon Sep 17 00:00:00 2001 From: Gregoire Date: Thu, 30 Sep 2021 00:22:03 +0200 Subject: [PATCH] feat: eclaireurs --- src/app/website/src/hooks/useGetMenus.ts | 4 +++- src/components/website/molecules/Header/ListLinks.tsx | 2 +- src/libs/i18n/resources/en/website.json | 4 +++- src/libs/i18n/resources/fr/website.json | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app/website/src/hooks/useGetMenus.ts b/src/app/website/src/hooks/useGetMenus.ts index 51a410231..290278043 100644 --- a/src/app/website/src/hooks/useGetMenus.ts +++ b/src/app/website/src/hooks/useGetMenus.ts @@ -34,7 +34,9 @@ const useGetMenus = (locale: SupportedLanguage): GetMenus => { const HEADER_LINKS = ['contribuer', 'faq', 'guides']; const FOOTER_LINKS = ['contact', 'about', 'faq', 'legal', 'cgu', 'press']; const footer: Link[] = []; - const header: Link[] = []; + const header: Link[] = [ + { label: t('header.guides'), href: () => navigate(t('links.guides')) } + ]; const formatLink = (node: GetLinksQuery['allMdx']['nodes'][0]) => ({ href: () => navigate(t('links.' + node.frontmatter?.name)) || '#', label: node.frontmatter?.label || '' diff --git a/src/components/website/molecules/Header/ListLinks.tsx b/src/components/website/molecules/Header/ListLinks.tsx index e76a85712..56cec24ea 100644 --- a/src/components/website/molecules/Header/ListLinks.tsx +++ b/src/components/website/molecules/Header/ListLinks.tsx @@ -3,7 +3,7 @@ import NavDesktopItem from '../../atoms/NavDesktopItem/NavDesktopItem'; export type Link = { label: string; - href: () => void; + href?: () => void; }; interface LinksProps { diff --git a/src/libs/i18n/resources/en/website.json b/src/libs/i18n/resources/en/website.json index 85866eda9..a1561d36b 100644 --- a/src/libs/i18n/resources/en/website.json +++ b/src/libs/i18n/resources/en/website.json @@ -1,6 +1,7 @@ { "header": { - "ctaText": "Add DisMoi" + "ctaText": "Add DisMoi", + "guides": "Guides" }, "footer": { "followUsOn": "Follow us on {{network}}", @@ -113,6 +114,7 @@ } }, "links": { + "guides": "/en/guides", "about": "/en/about", "contact": "/en/contact", "contribuer": "/en/creating-a-post", diff --git a/src/libs/i18n/resources/fr/website.json b/src/libs/i18n/resources/fr/website.json index 1a2e61050..6a29110a2 100644 --- a/src/libs/i18n/resources/fr/website.json +++ b/src/libs/i18n/resources/fr/website.json @@ -1,6 +1,7 @@ { "header": { - "ctaText": "Ajouter DisMoi" + "ctaText": "Ajouter DisMoi", + "guides": "Eclaireurs" }, "footer": { "followUsOn": "Suivez-nous sur {{network}}", @@ -113,6 +114,7 @@ } }, "links": { + "guides": "/fr/eclaireurs", "about": "/fr/a-propos", "contact": "/fr/contact", "contribuer": "/fr/contribuer",