// Copyright 2020-2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { IncomingCallBar } from './IncomingCallBar'; import { CallMode } from '../types/Calling'; import { setupI18n } from '../util/setupI18n'; import enMessages from '../../_locales/en/messages.json'; import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation'; const i18n = setupI18n('en', enMessages); const commonProps = { acceptCall: action('accept-call'), bounceAppIconStart: action('bounceAppIconStart'), bounceAppIconStop: action('bounceAppIconStop'), call: { conversationId: 'fake-conversation-id', callId: 0, isIncoming: true, isVideoCall: true, }, conversation: getDefaultConversation({ id: '3051234567', avatarPath: undefined, name: 'Rick Sanchez', phoneNumber: '3051234567', profileName: 'Rick Sanchez', title: 'Rick Sanchez', }), declineCall: action('decline-call'), i18n, notifyForCall: action('notify-for-call'), }; const directConversation = getDefaultConversation({ id: '3051234567', avatarPath: undefined, name: 'Rick Sanchez', phoneNumber: '3051234567', profileName: 'Rick Sanchez', title: 'Rick Sanchez', }); const groupConversation = getDefaultConversation({ avatarPath: undefined, name: 'Tahoe Trip', title: 'Tahoe Trip', type: 'group', }); storiesOf('Components/IncomingCallBar', module) .add('Incoming direct call (video)', () => ( )) .add('Incoming direct call (audio)', () => ( )) .add('Incoming group call (only calling you)', () => ( )) .add('Incoming group call (calling you and 1 other)', () => ( )) .add('Incoming group call (calling you and 2 others)', () => ( )) .add('Incoming group call (calling you and 3 others)', () => ( )) .add('Incoming group call (calling you and 4 others)', () => ( ));