-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #381 from MuckRock/380-sidebar-storybook
Basic sidebar stories
- Loading branch information
Showing
7 changed files
with
136 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"id": 1020, | ||
"avatar_url": "https://cdn.muckrock.com/media/avatars/20140211-0O1A7147-2.jpg", | ||
"feature_level": 2, | ||
"is_staff": true, | ||
"name": "Chris Amico", | ||
"organization": { | ||
"id": 125, | ||
"avatar_url": "https://cdn.muckrock.com/media/org_avatars/logo.png", | ||
"individual": false, | ||
"name": "MuckRock", | ||
"slug": "muckrock", | ||
"uuid": "97109cc6-e52e-41e7-adb7-834ab7c6819c", | ||
"monthly_credits": 7083, | ||
"purchased_credits": 0, | ||
"credit_reset_date": "2023-12-16", | ||
"monthly_credit_allowance": 10000, | ||
"plan": "Admin" | ||
}, | ||
"organizations": [ | ||
19198, | ||
170, | ||
125 | ||
], | ||
"admin_organizations": [ | ||
19198, | ||
170 | ||
], | ||
"username": "chrisamico", | ||
"uuid": "800bbb85-ea7a-46e9-8f56-16f862e66e52", | ||
"verified_journalist": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<script context="module"> | ||
import { Story } from "@storybook/addon-svelte-csf"; | ||
import Project from "../Project.svelte"; | ||
import projects from "../../fixtures/projects.json"; | ||
export const meta = { | ||
title: "App / Sidebar / Project", | ||
component: Project, | ||
parameters: { layout: "fullscreen" }, | ||
}; | ||
</script> | ||
|
||
<Story name="default"> | ||
<Project project={projects.results[0]} /> | ||
</Story> |
28 changes: 28 additions & 0 deletions
28
src/pages/app/sidebar/stories/ProjectFilters.stories.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script context="module"> | ||
import { Story } from "@storybook/addon-svelte-csf"; | ||
import ProjectFilters from "../ProjectFilters.svelte"; | ||
import * as mock from "../../stories/mock.js"; | ||
export const meta = { | ||
title: "App / Sidebar / Project Filters", | ||
component: ProjectFilters, | ||
parameters: { layout: "fullscreen" }, | ||
}; | ||
</script> | ||
|
||
<Story | ||
name="default" | ||
parameters={{ | ||
msw: { | ||
handlers: [ | ||
mock.users.data, | ||
mock.users.me, | ||
mock.organizations.data, | ||
mock.projects.data, | ||
], | ||
}, | ||
}} | ||
> | ||
<ProjectFilters /> | ||
</Story> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script context="module"> | ||
import { Story } from "@storybook/addon-svelte-csf"; | ||
import Projects from "../Projects.svelte"; | ||
import * as mock from "../../stories/mock.js"; | ||
export const meta = { | ||
title: "App / Sidebar / Projects", | ||
component: Projects, | ||
parameters: { layout: "fullscreen" }, | ||
}; | ||
</script> | ||
|
||
<Story | ||
name="default" | ||
parameters={{ | ||
msw: { | ||
handlers: [ | ||
mock.users.data, | ||
mock.users.me, | ||
mock.organizations.data, | ||
mock.projects.data, | ||
], | ||
}, | ||
}} | ||
> | ||
<Projects /> | ||
</Story> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script context="module"> | ||
import { Story } from "@storybook/addon-svelte-csf"; | ||
import Sidebar from "../Sidebar.svelte"; | ||
import * as mock from "../../stories/mock.js"; | ||
export const meta = { | ||
title: "App / Sidebar / Sidebar", | ||
component: Sidebar, | ||
parameters: { layout: "fullscreen" }, | ||
}; | ||
</script> | ||
|
||
<Story | ||
name="default" | ||
parameters={{ | ||
msw: { | ||
handlers: [ | ||
mock.users.data, | ||
mock.users.me, | ||
mock.organizations.data, | ||
mock.projects.data, | ||
], | ||
}, | ||
}} | ||
> | ||
<Sidebar expanded /> | ||
</Story> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters