Skip to content

Commit 3eeb8d0

Browse files
committed
tweak story parameters
1 parent d86c20e commit 3eeb8d0

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

site/.storybook/preview.jsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,16 @@ export const parameters = {
7676
date: /Date$/,
7777
},
7878
},
79+
viewport: {
80+
viewports: {
81+
ipad: {
82+
name: "iPad Mini",
83+
styles: {
84+
height: "1024px",
85+
width: "768px",
86+
},
87+
type: "tablet",
88+
},
89+
},
90+
},
7991
};

site/src/components/Dashboard/Navbar/NavbarView.stories.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { Meta, StoryObj } from "@storybook/react";
2-
import { chromatic } from "testHelpers/chromatic";
2+
import { chromaticWithTablet } from "testHelpers/chromatic";
33
import { MockUser, MockUser2 } from "testHelpers/entities";
44
import { NavbarView } from "./NavbarView";
55

66
const meta: Meta<typeof NavbarView> = {
77
title: "components/NavbarView",
8-
parameters: { chromatic },
8+
parameters: { chromatic: chromaticWithTablet },
99
component: NavbarView,
1010
args: {
1111
user: MockUser,
@@ -25,12 +25,3 @@ export const ForMember: Story = {
2525
canViewAllUsers: false,
2626
},
2727
};
28-
29-
export const SmallViewport: Story = {
30-
parameters: {
31-
viewport: {
32-
defaultViewport: "tablet",
33-
},
34-
chromatic: { viewports: [420] },
35-
},
36-
};

site/src/testHelpers/chromatic.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ export const chromatic = {
44
light: { theme: "light" },
55
},
66
};
7+
8+
export const chromaticWithTablet = {
9+
modes: {
10+
"dark desktop": { theme: "dark" },
11+
"light tablet": { theme: "light", viewport: "ipad" },
12+
},
13+
};

0 commit comments

Comments
 (0)