From 59687dad49333855d847e6a4e550ea472e22d17d Mon Sep 17 00:00:00 2001 From: Sven van de Scheur Date: Tue, 16 Jan 2024 09:35:23 +0100 Subject: [PATCH] :recycle: #4 - refactor: replace global decorator with smaller scoped decorators --- .storybook/preview.tsx | 13 ------------- src/components/dropdown/dropdown.stories.tsx | 8 ++++++++ src/components/navbar/navbar.stories.tsx | 8 ++++++++ src/components/toolbar/toolbar.stories.tsx | 8 ++++++++ 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index ac78ae5f..d1a5386b 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,20 +1,7 @@ import type { Preview } from "@storybook/react"; import * as React from "react"; -import { Page } from "../src"; - const preview: Preview = { - decorators: [ - (Story, { parameters }) => { - return parameters.ignoreGlobalDecorator ? ( - - ) : ( - - - - ); - }, - ], parameters: { actions: { argTypesRegex: "^on[A-Z].*" }, controls: { diff --git a/src/components/dropdown/dropdown.stories.tsx b/src/components/dropdown/dropdown.stories.tsx index 490f0e72..db46bae8 100644 --- a/src/components/dropdown/dropdown.stories.tsx +++ b/src/components/dropdown/dropdown.stories.tsx @@ -4,12 +4,20 @@ import React from "react"; import { Button, ButtonLink } from "../button"; import { Outline } from "../icon"; +import { Page } from "../page"; import { Toolbar } from "../toolbar"; import { Dropdown } from "./dropdown"; const meta = { title: "Controls/Dropdown", component: Dropdown, + decorators: [ + (Story) => ( + + + + ), + ], parameters: { layout: "fullscreen", }, diff --git a/src/components/navbar/navbar.stories.tsx b/src/components/navbar/navbar.stories.tsx index 2e4ce145..1a6b8098 100644 --- a/src/components/navbar/navbar.stories.tsx +++ b/src/components/navbar/navbar.stories.tsx @@ -4,11 +4,19 @@ import React from "react"; import { Button, ButtonLink } from "../button"; import { Outline } from "../icon"; +import { Page } from "../page"; import { Navbar } from "./navbar"; const meta = { title: "Controls/Navbar", component: Navbar, + decorators: [ + (Story) => ( + + + + ), + ], } satisfies Meta; export default meta; diff --git a/src/components/toolbar/toolbar.stories.tsx b/src/components/toolbar/toolbar.stories.tsx index 93d88f25..dddf4713 100644 --- a/src/components/toolbar/toolbar.stories.tsx +++ b/src/components/toolbar/toolbar.stories.tsx @@ -3,12 +3,20 @@ import React from "react"; import { Button, ButtonLink } from "../button"; import { Outline } from "../icon"; +import { Page } from "../page"; import { A } from "../typography"; import { Toolbar } from "./toolbar"; const meta = { title: "Controls/Toolbar", component: Toolbar, + decorators: [ + (Story) => ( + + + + ), + ], } satisfies Meta; export default meta;