import React from 'react' import type { Meta, StoryObj } from '@storybook/react' import { useState } from 'react' import Notifications from './Notifications' import NotificationItemImage from './NotificationItemImage' import { NFTCategory, Rarity, NotificationType } from '@dcl/schemas' import BidReceived from '../Icons/Notifications/BidReceived' import { NotificationActiveTab } from './types' import { getBGColorByRarity } from './utils' import GovernanceAnnouncementNotification from './NotificationTypes/Governance/GovernanceAnnouncementNotification' import GovernanceAuthoredProposalFinishedNotification from './NotificationTypes/Governance/GovernanceAuthoredProposalFinishedNotification' import GovernanceCoauthorRequestedNotification from './NotificationTypes/Governance/GovernanceCoauthorRequestedNotification' import GovernanceCliffEndedNotification from './NotificationTypes/Governance/GovernanceCliffEndedNotification' import GovernanceNewCommentOnProposalNotification from './NotificationTypes/Governance/GovernanceNewCommentOnProposalNotification' import GovernanceNewCommentOnProjectUpdateNotification from './NotificationTypes/Governance/GovernanceNewCommentOnProjectUpdateNotification' import GovernanceVotingEndedVoterNotification from './NotificationTypes/Governance/GovernanceVotingEndedVoterNotification' import GovernanceProposalEnactedNotification from './NotificationTypes/Governance/GovernanceProposalEnactedNotification' import { LandRentalEndedNotification, LandRentedNotification, RewardAssignedNotification, EventsStartedNotification, EventsStartsSoonNotification, GovernancePitchPassedNotification, GovernanceTenderPassedNotification, WorldsPermissionGrantedNotification, WorldsPermissionRevokedNotification, GovernanceWhaleVoteNotification, GovernanceVotedOnBehalfNotification } from './NotificationTypes' import { shorten } from '../AddressField/utils' import RewardInProgressNotification from './NotificationTypes/Reward/RewardInProgressNotification' import RewardDelayedNotification from './NotificationTypes/Reward/RewardDelayedNotification' import CampaignOutOfStockNotification from './NotificationTypes/Reward/CampaignOutOfStockNotification' import CampaignOutOfFundsNotification from './NotificationTypes/Reward/CampaignOutOfFundsNotification' import CampaignGasPriceHigherThanExpectedNotification from './NotificationTypes/Reward/CampaignGasPriceHigherThanExpectedNotification' const meta: Meta = { title: 'Notifications Toggle', component: Notifications } export default meta type Story = StoryObj export const WithoutNewNotifications: Story = { render: () => { return (
console.log(newTab)} onClick={() => console.log('Toggle button')} onBegin={() => console.log('Begin')} onClose={(_, m) => console.log(m)} />
) } } export const WithNewNotificatitons: Story = { render: () => { return (
console.log(newTab)} onClick={() => console.log('Toggle button')} onBegin={() => console.log('Begin')} onClose={(_, m) => console.log(m)} />
) } } export const Onboarding: Story = { render: () => { return (
console.log(newTab)} locale="en" onClick={() => console.log('Toggle button')} onBegin={() => console.log('Begin')} onClose={(_, m) => console.log(m)} />
) } } export const OpenNotLoading: Story = { render: () => { const [tab, setTab] = useState('newest') return (
setTab(newTab)} onClick={() => console.log('Toggle button')} onBegin={() => console.log('Begin')} onClose={(_, m) => console.log(m)} renderProfile={(address: string) => shorten(address)} />
) } } export const OpenNotLoadingButEmpty: Story = { render: () => { return (
console.log(newTab)} onClick={() => console.log('Toggle button')} onBegin={() => console.log('Begin')} onClose={(_, m) => console.log(m)} />
) } } export const OpenLoading: Story = { render: () => { return (
console.log(newTab)} onClick={() => console.log('Toggle button')} onBegin={() => console.log('Begin')} onClose={(_, m) => console.log(m)} />
) } } export const NotificationItemImageStory: Story = { render: () => { return (
} />
) } } export const GovernanceNotifications: Story = { render: () => { return (
) } } export const LandNotifications: Story = { render: () => { return (
shorten(address)} />
) } } export const RewardNotifications: Story = { render: () => { return (
) } } export const CampaignNotifications: Story = { render: () => { return (
) } } export const EventsNotifications: Story = { render: () => { const futureStartDate = new Date() futureStartDate.setSeconds(futureStartDate.getSeconds() + 50) const pastStartDate = new Date() pastStartDate.setSeconds(pastStartDate.getSeconds() - 50) return (
) } } export const WorldsNotifications: Story = { render: () => { return (
) } }