2022-04-28 08:19:20 +02:00
import React from 'react' ;
import { ComponentStory , ComponentMeta } from '@storybook/react' ;
2022-05-30 06:52:38 +02:00
import { RecoilRoot } from 'recoil' ;
import BrowserNotifyModal from '../components/modals/BrowserNotify/BrowserNotifyModal' ;
2022-05-13 05:52:19 +02:00
import BrowserNotifyModalMock from './assets/mocks/notify-modal.png' ;
2022-04-28 08:19:20 +02:00
const Example = ( ) = > (
< div >
2022-05-12 23:45:56 +02:00
< BrowserNotifyModal / >
2022-04-28 08:19:20 +02:00
< / div >
) ;
export default {
2022-05-12 23:45:56 +02:00
title : 'owncast/Modals/Browser Notifications' ,
2022-04-28 08:19:20 +02:00
component : BrowserNotifyModal ,
2022-05-13 05:52:19 +02:00
parameters : {
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:
- Verify the browser supports notifications .
- Handle errors that come back from the server .
- Have an enabled and disabled state with accurate information about each .
` ,
} ,
} ,
} ,
2022-04-28 08:19:20 +02:00
} as ComponentMeta < typeof BrowserNotifyModal > ;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2022-05-30 06:52:38 +02:00
const Template : ComponentStory < typeof BrowserNotifyModal > = args = > (
< RecoilRoot >
< Example / >
< / RecoilRoot >
) ;
2022-04-28 08:19:20 +02:00
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const Basic = Template . bind ( { } ) ;