From 037ae75b0c2541a64cd72589a14b26192d511973 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Fri, 9 Apr 2021 16:40:46 -0400 Subject: [PATCH] Refactor decorators for consistentcy --- storybook/preview.js | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/storybook/preview.js b/storybook/preview.js index 136b2b2..46f9702 100644 --- a/storybook/preview.js +++ b/storybook/preview.js @@ -28,28 +28,27 @@ export const globalTypes = { }, }; -/**Defines global theme ALL stories stories. - * * @type {Object | Function} - */ -const withThemeProvider = (Story, context) => { - const theme = webqueueTheme(context.globals.theme); - return ( - - - - ) -} /** - * Wraps all sotrys in the defined decorators. - * @type {Array[]} - */ + * Array + * @type {Array} + * @see https://storybook.js.org/docs/react/writing-stories/decorators + */ export const decorators = [ + // Provide custom webqueue2 Theme + (Story, context) => { + const theme = webqueueTheme(context.globals.theme); + return ( + + + + ); + }, + // Provide Item context (Story) => ( ), - withThemeProvider ]; /**Set of static metadata for a story. Is also used to define the sort order of the stories and backgrounds for every story.