Skip to content

Commit

Permalink
Added toolbar icon for Dark mode controls in Storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
wrigh393 committed Mar 24, 2021
1 parent 652ef98 commit ffff828
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
import React from "react";
import React, { useState } from "react";
import ItemProvider from '../src/components/ItemProvider';
import { ThemeProvider } from "@material-ui/core/styles";
import webqueueTheme from "../src/theme";

const theme = webqueueTheme();
const theme = webqueueTheme(false);

export const globalTypes = {
theme: {
name: 'Theme',
description: 'Global theme for components',
defaultValue: 'false',
toolbar: {
icon: 'mirror',
// array of plain string values or MenuItem shape (see below)
items: ["light", "dark"],
},
},
};

export const decorators = [
(Story) => (
<ItemProvider>
<Story />
</ItemProvider>
),
(Story) => (
(Story, context) => (
<ThemeProvider theme={theme}>
<Story />
<Story {...context} />
</ThemeProvider>
),
];
Expand Down

0 comments on commit ffff828

Please sign in to comment.