NotifyReminderPopup.stories.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* eslint-disable no-alert */
  2. import React from 'react';
  3. import { ComponentStory, ComponentMeta } from '@storybook/react';
  4. import { NotifyReminderPopup } from './NotifyReminderPopup';
  5. import Mock from '../../../stories/assets/mocks/notify-popup.png';
  6. const Example = args => (
  7. <div style={{ margin: '20px', marginTop: '130px' }}>
  8. <NotifyReminderPopup {...args}>
  9. <button type="button">notify button</button>
  10. </NotifyReminderPopup>
  11. </div>
  12. );
  13. export default {
  14. title: 'owncast/Components/Notify Reminder',
  15. component: NotifyReminderPopup,
  16. parameters: {
  17. design: {
  18. type: 'image',
  19. url: Mock,
  20. },
  21. docs: {
  22. description: {
  23. component: `After visiting the page three times this popup reminding you that you can register for live stream notifications shows up.
  24. Clicking it will make the notification modal display. Clicking the "X" will hide the modal and make it never show again.`,
  25. },
  26. },
  27. },
  28. } as ComponentMeta<typeof NotifyReminderPopup>;
  29. const Template: ComponentStory<typeof NotifyReminderPopup> = args => <Example {...args} />;
  30. export const Active = Template.bind({});
  31. Active.args = {
  32. open: true,
  33. notificationClicked: () => {
  34. alert('notification clicked');
  35. },
  36. notificationClosed: () => {
  37. alert('notification closed');
  38. },
  39. };
  40. export const InActive = Template.bind({});
  41. InActive.args = {
  42. open: false,
  43. };