// Copyright 2021-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; import { action } from '@storybook/addon-actions'; import { setupI18n } from '../../util/setupI18n'; import enMessages from '../../../_locales/en/messages.json'; import { CallMode } from '../../types/Calling'; import { CallingNotification } from './CallingNotification'; import type { CallingNotificationType } from '../../util/callingNotification'; const i18n = setupI18n('en', enMessages); export default { title: 'Components/Conversation/CallingNotification', }; const getCommonProps = () => ({ conversationId: 'fake-conversation-id', i18n, isNextItemCallingNotification: false, messageId: 'fake-message-id', now: Date.now(), returnToActiveCall: action('returnToActiveCall'), startCallingLobby: action('startCallingLobby'), }); /* */ export const AcceptedIncomingAudioCall = (): JSX.Element => ( ); export const AcceptedIncomingVideoCall = (): JSX.Element => ( ); export const DeclinedIncomingAudioCall = (): JSX.Element => ( ); export const DeclinedIncomingVideoCall = (): JSX.Element => ( ); export const AcceptedOutgoingAudioCall = (): JSX.Element => ( ); export const AcceptedOutgoingVideoCall = (): JSX.Element => ( ); export const DeclinedOutgoingAudioCall = (): JSX.Element => ( ); export const DeclinedOutgoingVideoCall = (): JSX.Element => ( ); export const TwoIncomingDirectCallsBackToBack = (): JSX.Element => { const call1: CallingNotificationType = { callMode: CallMode.Direct, wasIncoming: true, wasVideoCall: true, wasDeclined: false, acceptedTime: 1618894800000, endedTime: 1618894800000, }; const call2: CallingNotificationType = { callMode: CallMode.Direct, wasIncoming: true, wasVideoCall: false, wasDeclined: false, endedTime: 1618894800000, }; return ( <> ); }; TwoIncomingDirectCallsBackToBack.story = { name: 'Two incoming direct calls back-to-back', }; export const TwoOutgoingDirectCallsBackToBack = (): JSX.Element => { const call1: CallingNotificationType = { callMode: CallMode.Direct, wasIncoming: false, wasVideoCall: true, wasDeclined: false, acceptedTime: 1618894800000, endedTime: 1618894800000, }; const call2: CallingNotificationType = { callMode: CallMode.Direct, wasIncoming: false, wasVideoCall: false, wasDeclined: false, endedTime: 1618894800000, }; return ( <> ); }; TwoOutgoingDirectCallsBackToBack.story = { name: 'Two outgoing direct calls back-to-back', }; export const GroupCallByUnknown = (): JSX.Element => ( ); export const GroupCallByYou = (): JSX.Element => ( ); export const GroupCallBySomeone = (): JSX.Element => ( ); export const GroupCallStartedBySomeoneWithALongName = (): JSX.Element => { const longName = '😤🪐🦆'.repeat(50); return ( ); }; GroupCallStartedBySomeoneWithALongName.story = { name: 'Group call: started by someone with a long name', }; export const GroupCallActiveCallFull = (): JSX.Element => ( ); GroupCallActiveCallFull.story = { name: 'Group call: active, call full', }; export const GroupCallEnded = (): JSX.Element => ( ); GroupCallEnded.story = { name: 'Group call: ended', };