From 6c0ed01f445be40b2d27e5f8ed39507a63f45a59 Mon Sep 17 00:00:00 2001 From: Mesut Koca Date: Tue, 3 Mar 2020 02:04:43 +0300 Subject: [PATCH] fix(storybook): fix toast issue in storybook --- stories/10-Toast.stories.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/stories/10-Toast.stories.js b/stories/10-Toast.stories.js index 502994dc..1c903553 100644 --- a/stories/10-Toast.stories.js +++ b/stories/10-Toast.stories.js @@ -1,9 +1,26 @@ import { storiesOf } from '@storybook/vue' import { Button } from '../packages/kiwi-core/src' +import { colorModeObserver } from '../packages/kiwi-core/src/utils/color-mode-observer' + +const watch = { + $theme: { + immediate: true, + handler (theme) { + colorModeObserver.theme = theme() + } + }, + $icons: { + immediate: true, + handler (icons) { + colorModeObserver.icons = icons + } + } +} storiesOf('UI | Toast', module) .add('Simple Toast', () => ({ components: { Button }, + watch, inject: ['$theme', '$icons'], methods: { showToast () { @@ -24,6 +41,7 @@ storiesOf('UI | Toast', module) })) .add('With status', () => ({ components: { Button }, + watch, inject: ['$theme', '$icons'], methods: { infoToast () { @@ -78,6 +96,7 @@ storiesOf('UI | Toast', module) })) .add('With variant', () => ({ components: { Button }, + watch, inject: ['$theme', '$icons'], methods: { successToast (variant = 'solid') {