Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tweak story parameters
  • Loading branch information
aslilac committed Dec 18, 2023
commit 3eeb8d0ef6324eba34cde7ca6992ea261a6722e9
12 changes: 12 additions & 0 deletions site/.storybook/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,16 @@ export const parameters = {
date: /Date$/,
},
},
viewport: {
viewports: {
ipad: {
name: "iPad Mini",
styles: {
height: "1024px",
width: "768px",
},
type: "tablet",
},
},
},
};
13 changes: 2 additions & 11 deletions site/src/components/Dashboard/Navbar/NavbarView.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Meta, StoryObj } from "@storybook/react";
import { chromatic } from "testHelpers/chromatic";
import { chromaticWithTablet } from "testHelpers/chromatic";
import { MockUser, MockUser2 } from "testHelpers/entities";
import { NavbarView } from "./NavbarView";

const meta: Meta<typeof NavbarView> = {
title: "components/NavbarView",
parameters: { chromatic },
parameters: { chromatic: chromaticWithTablet },
component: NavbarView,
args: {
user: MockUser,
Expand All @@ -25,12 +25,3 @@ export const ForMember: Story = {
canViewAllUsers: false,
},
};

export const SmallViewport: Story = {
parameters: {
viewport: {
defaultViewport: "tablet",
},
chromatic: { viewports: [420] },
},
};
7 changes: 7 additions & 0 deletions site/src/testHelpers/chromatic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ export const chromatic = {
light: { theme: "light" },
},
};

export const chromaticWithTablet = {
modes: {
"dark desktop": { theme: "dark" },
"light tablet": { theme: "light", viewport: "ipad" },
},
};