import { ComponentStory, ComponentMeta } from '@storybook/react'; import React from 'react'; import Notification from '../../components/Notification/Notification'; import { Button } from '../Button'; import { iconTypes, TIconType } from '../Icon/collection'; import NotificationProvider, { useNotification } from './NotificationProvider'; import { IPosition, notifyType } from './types'; export default { title: '5.Popup/Notification', component: Notification, decorators: [ (Story) => ( ), ], } as ComponentMeta; const Template: ComponentStory = (args) => ( ); const HookTemplate: ComponentStory = () => { const dispatch = useNotification(); const handleNewNotification = ( type: notifyType, icon?: TIconType, position?: IPosition, ) => { dispatch({ type, message: 'Somebody messaged you', title: 'New Notification', icon, position: position || 'topR', }); }; return ( <>

Types:

Position:

); }; export const hookDemo = HookTemplate.bind({}); export const Regular = Template.bind({}); Regular.args = { id: 'test-Notification', message: 'Somebody messaged you', title: 'New Notification', }; export const Standard = Template.bind({}); Standard.args = { message: 'Kresimir: Thank you for sharin..', }; export const CustomIcon = Template.bind({}); CustomIcon.args = { icon: iconTypes.cloud, message: 'TX: 0x2134...e82c5', title: 'New Event Sync', };