Include sender in group update notifications

This commit is contained in:
Scott Nonnenberg 2020-03-26 14:47:35 -07:00
parent d88c21e5b6
commit 71436d18e2
28 changed files with 1016 additions and 472 deletions

View file

@ -14,32 +14,15 @@ import { storiesOf } from '@storybook/react';
//import { boolean, select } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
// @ts-ignore
import gif from '../../fixtures/giphy-GVNvOUpeYmI7e.gif';
// @ts-ignore
import png from '../../fixtures/freepngs-2cd43b_bed7d1327e88454487397574d87b64dc_mv2.png';
// @ts-ignore
import landscapeGreen from '../../fixtures/1000x50-green.jpeg';
// @ts-ignore
import landscapePurple from '../../fixtures/200x50-purple.png';
import {
gifObjectUrl,
landscapeGreenObjectUrl,
landscapePurpleObjectUrl,
pngObjectUrl,
} from '../storybook/Fixtures';
const i18n = setupI18n('en', enMessages);
function makeObjectUrl(data: ArrayBuffer, contentType: string): string {
const blob = new Blob([data], {
type: contentType,
});
return URL.createObjectURL(blob);
}
// 320x240
const gifObjectUrl = makeObjectUrl(gif, 'image/gif');
// 800×1200
const pngObjectUrl = makeObjectUrl(png, 'image/png');
const landscapeGreenObjectUrl = makeObjectUrl(landscapeGreen, 'image/jpeg');
const landscapePurpleObjectUrl = makeObjectUrl(landscapePurple, 'image/png');
const messageLookup: Map<string, MessageSearchResultPropsType> = new Map();
const CONTACT = 'contact' as 'contact';
@ -64,6 +47,7 @@ messageLookup.set('1-guid-guid-guid-guid-guid', {
from: {
phoneNumber: '(202) 555-0020',
isMe: true,
color: 'blue',
avatarPath: gifObjectUrl,
},
to: {
@ -116,6 +100,7 @@ messageLookup.set('4-guid-guid-guid-guid-guid', {
from: {
phoneNumber: '(202) 555-0020',
isMe: true,
color: 'light_green',
avatarPath: gifObjectUrl,
},
to: {
@ -160,6 +145,7 @@ const conversations = [
phoneNumber: '(202) 555-0011',
name: 'Everyone 🌆',
type: GROUP,
color: 'signal-blue' as 'signal-blue',
avatarPath: landscapeGreenObjectUrl,
isMe: false,
lastUpdated: Date.now() - 5 * 60 * 1000,
@ -177,6 +163,7 @@ const conversations = [
id: '+12025550012',
phoneNumber: '(202) 555-0012',
name: 'Everyone Else 🔥',
color: 'pink' as 'pink',
type: DIRECT,
avatarPath: landscapePurpleObjectUrl,
isMe: false,
@ -198,6 +185,7 @@ const contacts = [
id: '+12025550013',
phoneNumber: '(202) 555-0013',
name: 'The one Everyone',
color: 'blue' as 'blue',
type: DIRECT,
avatarPath: gifObjectUrl,
isMe: false,
@ -213,7 +201,7 @@ const contacts = [
phoneNumber: '(202) 555-0014',
name: 'No likey everyone',
type: DIRECT,
color: 'red',
color: 'red' as 'red',
isMe: false,
lastUpdated: Date.now() - 11 * 60 * 1000,
unreadCount: 0,