Skip to content

Commit

Permalink
test: migrate to viewport globals API
Browse files Browse the repository at this point in the history
  • Loading branch information
codeincontext committed Dec 9, 2024
1 parent c361618 commit 2cee76c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions apps/nextjs/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const config: StorybookConfig = {
name: getAbsolutePath("@storybook/nextjs"),
options: {},
},
features: {
viewportStoryGlobals: true,
},
staticDirs: ["../public", "./public"],
typescript: {
check: false,
Expand Down
6 changes: 5 additions & 1 deletion apps/nextjs/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,26 @@ const preview: Preview = {
},
},
viewport: {
viewports: {
options: {
mobile: {
name: "Mobile",
styles: { width: "375px", height: "800px" },
type: "mobile",
},
mobileWide: {
name: "Mobile Wide",
styles: { width: "430px", height: "930px" },
type: "mobile",
},
desktop: {
name: "Desktop",
styles: { width: "1200px", height: "1000px" },
type: "desktop",
},
desktopWide: {
name: "Desktop Wide",
styles: { width: "1400px", height: "1000px" },
type: "desktop",
},
},
},
Expand Down

0 comments on commit 2cee76c

Please sign in to comment.