// Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { ComponentProps } from 'react'; import React from 'react'; import { action } from '@storybook/addon-actions'; import { setupI18n } from '../util/setupI18n'; import enMessages from '../../_locales/en/messages.json'; import { getFakeBadge, getFakeBadges } from '../test-both/helpers/getFakeBadge'; import { repeat, zipObject } from '../util/iterables'; import { BadgeImageTheme } from '../badges/BadgeImageTheme'; import { BadgeDialog } from './BadgeDialog'; const i18n = setupI18n('en', enMessages); export default { title: 'Components/BadgeDialog', }; const defaultProps: ComponentProps = { areWeASubscriber: false, badges: getFakeBadges(3), firstName: 'Alice', i18n, onClose: action('onClose'), title: 'Alice Levine', }; export function NoBadgesClosedImmediately(): JSX.Element { return ; } NoBadgesClosedImmediately.story = { name: 'No badges (closed immediately)', }; export function OneBadge(): JSX.Element { return ; } OneBadge.story = { name: 'One badge', }; export function BadgeWithNoImageShouldBeImpossible(): JSX.Element { return ( ); } BadgeWithNoImageShouldBeImpossible.story = { name: 'Badge with no image (should be impossible)', }; export function BadgeWithPendingImage(): JSX.Element { return ( ); } BadgeWithPendingImage.story = { name: 'Badge with pending image', }; export function BadgeWithOnlyOneLowDetailImage(): JSX.Element { return ( ); } BadgeWithOnlyOneLowDetailImage.story = { name: 'Badge with only one, low-detail image', }; export function FiveBadges(): JSX.Element { return ; } FiveBadges.story = { name: 'Five badges', }; export function ManyBadges(): JSX.Element { return ; } ManyBadges.story = { name: 'Many badges', }; export function ManyBadgesUserIsASubscriber(): JSX.Element { return ( ); } ManyBadgesUserIsASubscriber.story = { name: 'Many badges, user is a subscriber', };