aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/templates/page
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-12-12 18:50:03 +0100
committerArmand Philippot <git@armandphilippot.com>2023-12-12 18:50:03 +0100
commit85c4c42bd601270d7be0f34a0767a34bb85e29bb (patch)
tree16a07a89cf209139672592fd6988f0c028acb7e9 /src/components/templates/page
parent93f87c10783e3d76f1dec667779aedffcae33a39 (diff)
refactor(hooks): rewrite useBreadcrumbs hook
* use next/router to get the slug instead of using props * handle cases where the current page title is not provided * update JSON-LD schema to match the example in documentation * add tests
Diffstat (limited to 'src/components/templates/page')
-rw-r--r--src/components/templates/page/page.stories.tsx4
-rw-r--r--src/components/templates/page/page.test.tsx4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/components/templates/page/page.stories.tsx b/src/components/templates/page/page.stories.tsx
index 8b1616b..3f03b44 100644
--- a/src/components/templates/page/page.stories.tsx
+++ b/src/components/templates/page/page.stories.tsx
@@ -173,8 +173,8 @@ HeaderBody.args = {
export const BreadcrumbsHeaderBody = Template.bind({});
BreadcrumbsHeaderBody.args = {
breadcrumbs: [
- { id: 'home', name: 'Home', url: '#home' },
- { id: 'blog', name: 'Blog', url: '#blog' },
+ { id: 'home', label: 'Home', slug: '#home' },
+ { id: 'blog', label: 'Blog', slug: '#blog' },
],
children: (
<>
diff --git a/src/components/templates/page/page.test.tsx b/src/components/templates/page/page.test.tsx
index fb06cb1..afe93ce 100644
--- a/src/components/templates/page/page.test.tsx
+++ b/src/components/templates/page/page.test.tsx
@@ -24,8 +24,8 @@ describe('Page', () => {
const body =
'Consequatur deleniti eligendi quidem sint et nobis ut qui. Dolores modi eos. Cupiditate aliquid sunt consequatur voluptatem laudantium.';
const breadcrumbs = [
- { id: 'home', name: 'Home', url: '#home' },
- { id: 'blog', name: 'Blog', url: '#blog' },
+ { id: 'home', label: 'Home', slug: '#home' },
+ { id: 'blog', label: 'Blog', slug: '#blog' },
] satisfies BreadcrumbsItem[];
render(