Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3172: Sort and group stories
Browse files Browse the repository at this point in the history
Prettier trailingComma none
cemalettin-work committed Oct 14, 2020
1 parent 3220395 commit 96e6492
Showing 6 changed files with 17 additions and 11 deletions.
9 changes: 8 additions & 1 deletion client/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -2,5 +2,12 @@ import "bootstrap/dist/css/bootstrap.css"
import "index.css"

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" }
actions: { argTypesRegex: "^on[A-Z].*" },
options: {
// Sort stories alphabetically
storySort: (a, b) =>
a[1].kind === b[1].kind
? 0
: a[1].id.localeCompare(b[1].id, undefined, { numeric: true })
}
}
3 changes: 1 addition & 2 deletions client/stories/Button.stories.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from "react"

import { Button } from "./Button"

export default {
title: "Example/Button",
title: "Storybook/Examples/Button",
component: Button,
argTypes: {
backgroundColor: { control: "color" }
3 changes: 1 addition & 2 deletions client/stories/Header.stories.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from "react"

import { Header } from "./Header"

export default {
title: "Example/Header",
title: "Storybook/Examples/Header",
component: Header
}

2 changes: 2 additions & 0 deletions client/stories/HeatMap.stories.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ import HeatMap from "../src/components/HeatMap"
import * as layouts from "../src/layouts"

const containerStyle = {
float: "right",
overflow: "hidden",
width: "100%",
minWidth: "700px", // week 7days, at least 100px width for a day
height: "350px", // week 7days, at least 50px height for a day,
6 changes: 3 additions & 3 deletions client/stories/Introduction.stories.mdx
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import Plugin from './assets/plugin.svg';
import Repo from './assets/repo.svg';
import StackAlt from './assets/stackalt.svg';

<Meta title="Example/Introduction" />
<Meta title="Storybook/Introduction" />

<style>{`
.subheading {
@@ -73,7 +73,7 @@ import StackAlt from './assets/stackalt.svg';
display: block;
margin-bottom: 2px;
}
.link-item img {
height: 40px;
width: 40px;
@@ -111,7 +111,7 @@ import StackAlt from './assets/stackalt.svg';
display: inline-block;
}
`}</style>

# Welcome to Storybook
5 changes: 2 additions & 3 deletions client/stories/Page.stories.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from "react"

import { Page } from "./Page"
import * as HeaderStories from "./Header.stories"
import { Page } from "./Page"

export default {
title: "Example/Page",
title: "Storybook/Examples/Page",
component: Page
}

0 comments on commit 96e6492

Please sign in to comment.