2023-11-07 06:35:05 +03:00
import { StoryFn , Meta } from '@storybook/react' ;
2022-05-30 07:52:38 +03:00
import { RecoilRoot } from 'recoil' ;
2022-09-07 10:00:28 +03:00
import { BrowserNotifyModal } from './BrowserNotifyModal' ;
2022-09-03 21:38:52 +03:00
import BrowserNotifyModalMock from '../../../stories/assets/mocks/notify-modal.png' ;
2022-04-28 09:19:20 +03:00
const Example = ( ) = > (
< div >
2022-05-13 00:45:56 +03:00
< BrowserNotifyModal / >
2022-04-28 09:19:20 +03:00
< / div >
) ;
2023-11-07 06:35:05 +03:00
const meta = {
2022-05-13 00:45:56 +03:00
title : 'owncast/Modals/Browser Notifications' ,
2022-04-28 09:19:20 +03:00
component : BrowserNotifyModal ,
2022-05-13 06:52:19 +03:00
parameters : {
2023-03-13 08:10:17 +03:00
chromatic : { diffThreshold : 0.9 } ,
2022-05-13 06:52:19 +03:00
design : {
type : 'image' ,
url : BrowserNotifyModalMock ,
scale : 0.5 ,
} ,
docs : {
description : {
component : ` The notify modal allows an end user to get notified when the stream goes live via [Browser Push Notifications](https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications) It must:
2022-09-03 21:38:52 +03:00
2022-05-13 06:52:19 +03:00
- Verify the browser supports notifications .
- Handle errors that come back from the server .
- Have an enabled and disabled state with accurate information about each .
` ,
} ,
} ,
} ,
2023-11-07 06:35:05 +03:00
} satisfies Meta < typeof BrowserNotifyModal > ;
2022-04-28 09:19:20 +03:00
2023-11-07 06:35:05 +03:00
export default meta ;
const Template : StoryFn < typeof BrowserNotifyModal > = ( ) = > (
2022-05-30 07:52:38 +03:00
< RecoilRoot >
< Example / >
< / RecoilRoot >
) ;
2022-04-28 09:19:20 +03:00
2023-11-07 06:35:05 +03:00
export const Basic = {
render : Template ,
} ;