Skip to content

Commit

Permalink
Add docs link, fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
campb303 committed Apr 5, 2021
1 parent 2f9c4f0 commit 79e643e
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/**Set globals imputs for ALL stories. Globals can only be defined here. */
/**
* Config file to control how stories are rendered in the Canvas.
* See: https://storybook.js.org/docs/react/configure/overview#configure-story-rendering
*/

import React from "react";
import ItemProvider from '../src/components/ItemProvider';
import { ThemeProvider } from "@material-ui/core/styles";
Expand All @@ -8,24 +12,24 @@ import webqueueTheme from "../src/theme";
* Adds a toolbar item that allow users to toggle dark mode on and off.
* @type {Object}
*/
export const globalTypes = {
theme: {
name: 'Set Dark Mode',
description: 'Global theme for components',
defaultValue: false,
toolbar: {
icon: 'mirror',
items: [
{ value: true, title: "Dark Mode active", icon: "contrast" },
{ value: false, title: "Dark Mode off", icon: "switchalt" }
export const globalTypes = {
theme: {
name: 'Set Dark Mode',
description: 'Global theme for components',
defaultValue: false,
toolbar: {
icon: 'mirror',
items: [
{ value: true, title: "Dark Mode active", icon: "contrast" },
{ value: false, title: "Dark Mode off", icon: "switchalt" }
],
},
},
};

/**Defines global theme ALL stories stories.
* * @type {Object | Function}
*/
*/
const withThemeProvider = (Story, context) => {
const theme = webqueueTheme(context.globals.theme);
return (
Expand All @@ -35,9 +39,9 @@ const withThemeProvider = (Story, context) => {
)
}
/**
* Wraps all sotrys in the defined decorators.
* @type {Array[]}
*/
* Wraps all sotrys in the defined decorators.
* @type {Array[]}
*/
export const decorators = [
(Story) => (
<ItemProvider>
Expand Down

0 comments on commit 79e643e

Please sign in to comment.