From a92f1291da08c9ed66eaa282d996d1c7cd304a98 Mon Sep 17 00:00:00 2001 From: svetlagasheva Date: Thu, 9 Jan 2020 18:44:05 +0200 Subject: [PATCH] storybook SimpleToast improved --- .../stories/Toast/SimpleToast/SimpleToast.js | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/storybook/stories/Toast/SimpleToast/SimpleToast.js b/storybook/stories/Toast/SimpleToast/SimpleToast.js index 65eb04376..4facc5297 100644 --- a/storybook/stories/Toast/SimpleToast/SimpleToast.js +++ b/storybook/stories/Toast/SimpleToast/SimpleToast.js @@ -2,11 +2,12 @@ const React = require('react'); const { storiesOf } = require('@storybook/react'); const { Toast } = require('stremio/common'); const styles = require('./styles'); +const { ToastsContainerProvider } = require('stremio/common/ToastsContainerContext'); storiesOf('Toast', module).add('SimpleToast', () => { const toastRef = React.useRef(null); - const showToast = (message) => React.useCallback(() => { + const showToast = React.useCallback((message) => { toastRef.current.show({ title: 'Something to take your attention', timeout: 0, @@ -17,7 +18,7 @@ storiesOf('Toast', module).add('SimpleToast', () => { }); }, [toastRef.current]); - const clickSuccess = showToast({ + const clickSuccess = () => showToast({ title: 'You clicked it', text: 'Congratulations! Click event handled successfully.', type: 'success', @@ -27,16 +28,18 @@ storiesOf('Toast', module).add('SimpleToast', () => { return (
- - - - - - - + + + + + + + - + + +
); });