Add "call back", "call again" buttons to timeline

This commit is contained in:
Evan Hahn 2021-09-10 18:59:41 -05:00 committed by GitHub
parent d94f1151b1
commit bfa0bbf7da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 203 additions and 71 deletions

View file

@ -9,6 +9,7 @@ import { setup as setupI18n } from '../../../js/modules/i18n';
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);
@ -19,6 +20,7 @@ const getCommonProps = () => ({
i18n,
messageId: 'fake-message-id',
messageSizeChanged: action('messageSizeChanged'),
nextItem: undefined,
returnToActiveCall: action('returnToActiveCall'),
startCallingLobby: action('startCallingLobby'),
});
@ -46,6 +48,64 @@ const getCommonProps = () => ({
});
});
story.add('Two incoming direct calls back-to-back', () => {
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 (
<>
<CallingNotification
{...getCommonProps()}
{...call1}
nextItem={{ type: 'callHistory', data: call2 }}
/>
<CallingNotification {...getCommonProps()} {...call2} />
</>
);
});
story.add('Two outgoing direct calls back-to-back', () => {
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 (
<>
<CallingNotification
{...getCommonProps()}
{...call1}
nextItem={{ type: 'callHistory', data: call2 }}
/>
<CallingNotification {...getCommonProps()} {...call2} />
</>
);
});
[
undefined,
{ isMe: false, title: 'Alice' },