From be4d907efb4e2fa658baa7c9b276ed282eb920db Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 14 Nov 2023 19:07:14 +0100 Subject: refactor(components, hooks): rewrite ToC and useHeadingsTree * replace TableOfContents component with TocWidget to keep the name of widget components coherent * replace `wrapper` prop with `tree` prop (the component no longer uses the hook, it is up to the consumer to provide the headings tree) * let consumer handle the widget title * add options to useHeadingsTree hook to retrieve only the wanted headings (and do not assume that h1 is unwanted) * expect an ref object instead of an element in useHeadingsTree hook * rename most of the types involved --- src/i18n/en.json | 8 ++++---- src/i18n/fr.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/i18n') diff --git a/src/i18n/en.json b/src/i18n/en.json index 02fe61b..008f476 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -471,10 +471,6 @@ "defaultMessage": "Search", "description": "SearchPage: SEO - Page title" }, - "WKG9wj": { - "defaultMessage": "Table of Contents", - "description": "TableOfContents: the widget title" - }, "WMqQrv": { "defaultMessage": "Search", "description": "SearchForm: button accessible name" @@ -555,6 +551,10 @@ "defaultMessage": "Main navigation", "description": "Layout: main nav accessible name" }, + "eys2uX": { + "defaultMessage": "Table of Contents", + "description": "PageLayout: table of contents title" + }, "fN04AJ": { "defaultMessage": "Download the CV in PDF", "description": "CVPage: download CV in PDF text" diff --git a/src/i18n/fr.json b/src/i18n/fr.json index 27eb582..c83d146 100644 --- a/src/i18n/fr.json +++ b/src/i18n/fr.json @@ -471,10 +471,6 @@ "defaultMessage": "Recherche", "description": "SearchPage: SEO - Page title" }, - "WKG9wj": { - "defaultMessage": "Table des matières", - "description": "TableOfContents: the widget title" - }, "WMqQrv": { "defaultMessage": "Rechercher", "description": "SearchForm: button accessible name" @@ -555,6 +551,10 @@ "defaultMessage": "Navigation principale", "description": "Layout: main nav accessible name" }, + "eys2uX": { + "defaultMessage": "Table des matières", + "description": "PageLayout: table of contents title" + }, "fN04AJ": { "defaultMessage": "Télécharger le CV au format PDF", "description": "CVPage: download CV in PDF text" -- cgit v1.2.3