Skip to content

Commit

Permalink
fix(storybook): fix toast issue in storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
koca committed Mar 2, 2020
1 parent 3294085 commit 6c0ed01
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions stories/10-Toast.stories.js
Original file line number Diff line number Diff line change
@@ -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 () {
Expand All @@ -24,6 +41,7 @@ storiesOf('UI | Toast', module)
}))
.add('With status', () => ({
components: { Button },
watch,
inject: ['$theme', '$icons'],
methods: {
infoToast () {
Expand Down Expand Up @@ -78,6 +96,7 @@ storiesOf('UI | Toast', module)
}))
.add('With variant', () => ({
components: { Button },
watch,
inject: ['$theme', '$icons'],
methods: {
successToast (variant = 'solid') {
Expand Down

0 comments on commit 6c0ed01

Please sign in to comment.