Skip to content

Commit

Permalink
♻️ #4 - refactor: replace global decorator with smaller scoped decora…
Browse files Browse the repository at this point in the history
…tors
  • Loading branch information
svenvandescheur committed Jan 16, 2024
1 parent 5ae8b15 commit 59687da
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
13 changes: 0 additions & 13 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -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 ? (
<Story />
) : (
<Page>
<Story />
</Page>
);
},
],
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
Expand Down
8 changes: 8 additions & 0 deletions src/components/dropdown/dropdown.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => (
<Page>
<Story />
</Page>
),
],
parameters: {
layout: "fullscreen",
},
Expand Down
8 changes: 8 additions & 0 deletions src/components/navbar/navbar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => (
<Page>
<Story />
</Page>
),
],
} satisfies Meta<typeof Navbar>;

export default meta;
Expand Down
8 changes: 8 additions & 0 deletions src/components/toolbar/toolbar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => (
<Page>
<Story />
</Page>
),
],
} satisfies Meta<typeof Toolbar>;

export default meta;
Expand Down

0 comments on commit 59687da

Please sign in to comment.