From 200f8210635a511135154947b85c6491b9ba10a8 Mon Sep 17 00:00:00 2001 From: Kar Rui Lau Date: Wed, 31 Jul 2024 14:08:28 +0800 Subject: [PATCH] feat: set fullscreen layout and remove autodocs for layout stories (#384) ### TL;DR Updated the Storybook layouts to include fullscreen parameter and autodocs tags for template layouts that should be in fullscreen. ### What changed? - Added `layout: fullscreen` parameter to the meta object for Article, Collection, Content, Homepage, NotFound, and Search story files. - Added `tags: ['!autodocs']` to the meta object for the same story files. - Updated the names of the default stories to match their corresponding layout names. ### How to test? 1. Run Storybook. 2. Verify that the specified stories are displayed in fullscreen. 3. Check that the tags for autodocs are present. ### Why make this change? To ensure consistency across the Storybook layouts and make use of the fullscreen parameter and autodocs tags for better documentation and presentation. --- .../src/templates/next/layouts/Article/Article.stories.tsx | 3 +++ .../templates/next/layouts/Collection/Collection.stories.tsx | 3 +++ .../src/templates/next/layouts/Content/Content.stories.tsx | 2 ++ .../src/templates/next/layouts/Homepage/Homepage.stories.tsx | 3 +++ .../src/templates/next/layouts/NotFound/NotFound.stories.tsx | 3 +++ .../src/templates/next/layouts/Search/Search.stories.tsx | 1 + 6 files changed, 15 insertions(+) diff --git a/packages/components/src/templates/next/layouts/Article/Article.stories.tsx b/packages/components/src/templates/next/layouts/Article/Article.stories.tsx index b2107d3585..9bb46e9bec 100644 --- a/packages/components/src/templates/next/layouts/Article/Article.stories.tsx +++ b/packages/components/src/templates/next/layouts/Article/Article.stories.tsx @@ -7,7 +7,9 @@ const meta: Meta = { title: "Next/Layouts/Article", component: ArticleLayout, argTypes: {}, + tags: ["!autodocs"], parameters: { + layout: "fullscreen", themes: { themeOverride: "Isomer Next", }, @@ -17,6 +19,7 @@ export default meta type Story = StoryObj export const Default: Story = { + name: "Article", args: { layout: "article", site: { diff --git a/packages/components/src/templates/next/layouts/Collection/Collection.stories.tsx b/packages/components/src/templates/next/layouts/Collection/Collection.stories.tsx index 882747f6ad..f2dcc9367a 100644 --- a/packages/components/src/templates/next/layouts/Collection/Collection.stories.tsx +++ b/packages/components/src/templates/next/layouts/Collection/Collection.stories.tsx @@ -7,7 +7,9 @@ const meta: Meta = { title: "Next/Layouts/Collection", component: CollectionLayout, argTypes: {}, + tags: ["!autodocs"], parameters: { + layout: "fullscreen", themes: { themeOverride: "Isomer Next", }, @@ -17,6 +19,7 @@ export default meta type Story = StoryObj export const Default: Story = { + name: "Collection", args: { layout: "collection", site: { diff --git a/packages/components/src/templates/next/layouts/Content/Content.stories.tsx b/packages/components/src/templates/next/layouts/Content/Content.stories.tsx index 0d5f0e804e..24ce4aba1d 100644 --- a/packages/components/src/templates/next/layouts/Content/Content.stories.tsx +++ b/packages/components/src/templates/next/layouts/Content/Content.stories.tsx @@ -6,7 +6,9 @@ const meta: Meta = { title: "Next/Layouts/Content", component: Content, argTypes: {}, + tags: ["!autodocs"], parameters: { + layout: "fullscreen", themes: { themeOverride: "Isomer Next", }, diff --git a/packages/components/src/templates/next/layouts/Homepage/Homepage.stories.tsx b/packages/components/src/templates/next/layouts/Homepage/Homepage.stories.tsx index e222a810e0..c80cf0b0ab 100644 --- a/packages/components/src/templates/next/layouts/Homepage/Homepage.stories.tsx +++ b/packages/components/src/templates/next/layouts/Homepage/Homepage.stories.tsx @@ -21,7 +21,9 @@ const meta: Meta = { component: Homepage, render: Template, argTypes: {}, + tags: ["!autodocs"], parameters: { + layout: "fullscreen", themes: { themeOverride: "Isomer Next", }, @@ -33,6 +35,7 @@ type Story = StoryObj const TEST_CLIENT_ID = "5485bb61-2d5d-440a-bc37-91c48fc0c9d4" export const Default: Story = { + name: "Homepage", args: { layout: "homepage", site: { diff --git a/packages/components/src/templates/next/layouts/NotFound/NotFound.stories.tsx b/packages/components/src/templates/next/layouts/NotFound/NotFound.stories.tsx index 1281f7e914..03e99d8eb8 100644 --- a/packages/components/src/templates/next/layouts/NotFound/NotFound.stories.tsx +++ b/packages/components/src/templates/next/layouts/NotFound/NotFound.stories.tsx @@ -7,7 +7,9 @@ const meta: Meta = { title: "Next/Layouts/NotFound", component: NotFoundLayout, argTypes: {}, + tags: ["!autodocs"], parameters: { + layout: "fullscreen", themes: { themeOverride: "Isomer Next", }, @@ -17,6 +19,7 @@ export default meta type Story = StoryObj export const Default: Story = { + name: "NotFound", args: { layout: "notfound", site: { diff --git a/packages/components/src/templates/next/layouts/Search/Search.stories.tsx b/packages/components/src/templates/next/layouts/Search/Search.stories.tsx index e1ba938d1b..69901d732b 100644 --- a/packages/components/src/templates/next/layouts/Search/Search.stories.tsx +++ b/packages/components/src/templates/next/layouts/Search/Search.stories.tsx @@ -27,6 +27,7 @@ const meta: Meta = { title: "Next/Layouts/Search", component: Template, argTypes: {}, + tags: ["!autodocs"], parameters: { themes: { themeOverride: "Isomer Next",