aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/templates/layout/layout.stories.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-05-16 12:46:38 +0200
committerArmand Philippot <git@armandphilippot.com>2022-05-16 12:46:38 +0200
commit2155550fa36a3bc3c8f66e0926530123b4018cd4 (patch)
tree1b7472d7ceeb9c95b2c6de6440b48b94405e155e /src/components/templates/layout/layout.stories.tsx
parent8a55aa83bd4b64d1d989cb49b7d9c3fdc1cc6ea5 (diff)
refactor: use custom hook for breadcrumb items and schema
Diffstat (limited to 'src/components/templates/layout/layout.stories.tsx')
-rw-r--r--src/components/templates/layout/layout.stories.tsx54
1 files changed, 40 insertions, 14 deletions
diff --git a/src/components/templates/layout/layout.stories.tsx b/src/components/templates/layout/layout.stories.tsx
index 2415412..105e808 100644
--- a/src/components/templates/layout/layout.stories.tsx
+++ b/src/components/templates/layout/layout.stories.tsx
@@ -1,5 +1,4 @@
import { ComponentMeta, ComponentStory } from '@storybook/react';
-import { IntlProvider } from 'react-intl';
import LayoutComponent from './layout';
/**
@@ -8,6 +7,10 @@ import LayoutComponent from './layout';
export default {
title: 'Templates/LayoutBase',
component: LayoutComponent,
+ args: {
+ breadcrumbSchema: [],
+ isHome: false,
+ },
argTypes: {
children: {
control: {
@@ -19,6 +22,31 @@ export default {
required: true,
},
},
+ breadcrumbSchema: {
+ control: {
+ type: 'null',
+ },
+ description: 'The JSON schema for breadcrumb items.',
+ type: {
+ name: 'object',
+ required: true,
+ value: {},
+ },
+ },
+ isHome: {
+ control: {
+ type: 'boolean',
+ },
+ description: 'Determine if it is the homepage.',
+ table: {
+ category: 'Options',
+ defaultValue: { summary: false },
+ },
+ type: {
+ name: 'boolean',
+ required: false,
+ },
+ },
className: {
control: {
type: 'text',
@@ -35,19 +63,17 @@ export default {
},
decorators: [
(Story) => (
- <IntlProvider locale="en">
- <div
- id="__next"
- style={{
- flex: 1,
- display: 'flex',
- flexFlow: 'column nowrap',
- minHeight: '100vh',
- }}
- >
- <Story />
- </div>
- </IntlProvider>
+ <div
+ id="__next"
+ style={{
+ flex: 1,
+ display: 'flex',
+ flexFlow: 'column nowrap',
+ minHeight: '100vh',
+ }}
+ >
+ <Story />
+ </div>
),
],
parameters: {