mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
Send related emoji along with Sticker, fix SendMessage types
This commit is contained in:
@@ -17,6 +17,8 @@ import {
|
||||
import { setupI18n } from '../../util/setupI18n';
|
||||
import enMessages from '../../../_locales/en/messages.json';
|
||||
|
||||
import { fakeAttachment } from '../../test-both/helpers/fakeAttachment';
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
const story = storiesOf('Components/Conversation/AttachmentList', module);
|
||||
@@ -33,11 +35,11 @@ const createProps = (overrideProps: Partial<Props> = {}): Props => ({
|
||||
story.add('One File', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_JPEG,
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
return <AttachmentList {...props} />;
|
||||
@@ -46,12 +48,12 @@ story.add('One File', () => {
|
||||
story.add('Multiple Visual Attachments', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_JPEG,
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: VIDEO_MP4,
|
||||
fileName: 'pixabay-Soap-Bubble-7141.mp4',
|
||||
url: '/fixtures/pixabay-Soap-Bubble-7141.mp4',
|
||||
@@ -62,12 +64,12 @@ story.add('Multiple Visual Attachments', () => {
|
||||
contentType: IMAGE_JPEG,
|
||||
path: 'originalpath',
|
||||
},
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_GIF,
|
||||
fileName: 'giphy-GVNv0UpeYm17e',
|
||||
url: '/fixtures/giphy-GVNvOUpeYmI7e.gif',
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
@@ -77,22 +79,22 @@ story.add('Multiple Visual Attachments', () => {
|
||||
story.add('Multiple with Non-Visual Types', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_JPEG,
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: stringToMIMEType('text/plain'),
|
||||
fileName: 'lorem-ipsum.txt',
|
||||
url: '/fixtures/lorem-ipsum.txt',
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: AUDIO_MP3,
|
||||
fileName: 'incompetech-com-Agnus-Dei-X.mp3',
|
||||
url: '/fixtures/incompetech-com-Agnus-Dei-X.mp3',
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: VIDEO_MP4,
|
||||
fileName: 'pixabay-Soap-Bubble-7141.mp4',
|
||||
url: '/fixtures/pixabay-Soap-Bubble-7141.mp4',
|
||||
@@ -103,12 +105,12 @@ story.add('Multiple with Non-Visual Types', () => {
|
||||
contentType: IMAGE_JPEG,
|
||||
path: 'originalpath',
|
||||
},
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_GIF,
|
||||
fileName: 'giphy-GVNv0UpeYm17e',
|
||||
url: '/fixtures/giphy-GVNvOUpeYmI7e.gif',
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ import { setupI18n } from '../../util/setupI18n';
|
||||
import enMessages from '../../../_locales/en/messages.json';
|
||||
import { IMAGE_GIF } from '../../types/MIME';
|
||||
|
||||
import { fakeAttachment } from '../../test-both/helpers/fakeAttachment';
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
const story = storiesOf('Components/Conversation/ContactDetail', module);
|
||||
@@ -72,10 +74,10 @@ const fullContact = {
|
||||
},
|
||||
],
|
||||
avatar: {
|
||||
avatar: {
|
||||
avatar: fakeAttachment({
|
||||
path: '/fixtures/giphy-GVNvOUpeYmI7e.gif',
|
||||
contentType: IMAGE_GIF,
|
||||
},
|
||||
}),
|
||||
isProfile: true,
|
||||
},
|
||||
email: [
|
||||
@@ -209,10 +211,10 @@ story.add('Loading Avatar', () => {
|
||||
const props = createProps({
|
||||
contact: {
|
||||
avatar: {
|
||||
avatar: {
|
||||
avatar: fakeAttachment({
|
||||
contentType: IMAGE_GIF,
|
||||
pending: true,
|
||||
},
|
||||
}),
|
||||
isProfile: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -13,6 +13,8 @@ import enMessages from '../../../_locales/en/messages.json';
|
||||
import { ContactFormType } from '../../types/EmbeddedContact';
|
||||
import { IMAGE_GIF } from '../../types/MIME';
|
||||
|
||||
import { fakeAttachment } from '../../test-both/helpers/fakeAttachment';
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
const story = storiesOf('Components/Conversation/EmbeddedContact', module);
|
||||
@@ -35,10 +37,10 @@ const createProps = (overrideProps: Partial<Props> = {}): Props => ({
|
||||
|
||||
const fullContact = {
|
||||
avatar: {
|
||||
avatar: {
|
||||
avatar: fakeAttachment({
|
||||
path: '/fixtures/giphy-GVNvOUpeYmI7e.gif',
|
||||
contentType: IMAGE_GIF,
|
||||
},
|
||||
}),
|
||||
isProfile: true,
|
||||
},
|
||||
email: [
|
||||
@@ -134,10 +136,10 @@ story.add('Loading Avatar', () => {
|
||||
displayName: 'Jerry Jordan',
|
||||
},
|
||||
avatar: {
|
||||
avatar: {
|
||||
avatar: fakeAttachment({
|
||||
pending: true,
|
||||
contentType: IMAGE_GIF,
|
||||
},
|
||||
}),
|
||||
isProfile: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -14,17 +14,21 @@ import { ThemeType } from '../../types/Util';
|
||||
import { setupI18n } from '../../util/setupI18n';
|
||||
import enMessages from '../../../_locales/en/messages.json';
|
||||
|
||||
import { fakeAttachment } from '../../test-both/helpers/fakeAttachment';
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
const story = storiesOf('Components/Conversation/Image', module);
|
||||
|
||||
const createProps = (overrideProps: Partial<Props> = {}): Props => ({
|
||||
alt: text('alt', overrideProps.alt || ''),
|
||||
attachment: overrideProps.attachment || {
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
url: pngUrl,
|
||||
},
|
||||
attachment:
|
||||
overrideProps.attachment ||
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
url: pngUrl,
|
||||
}),
|
||||
blurHash: text('blurHash', overrideProps.blurHash || ''),
|
||||
bottomOverlay: boolean('bottomOverlay', overrideProps.bottomOverlay || false),
|
||||
closeButton: boolean('closeButton', overrideProps.closeButton || false),
|
||||
@@ -99,11 +103,11 @@ story.add('Close Button', () => {
|
||||
|
||||
story.add('No Border or Background', () => {
|
||||
const props = createProps({
|
||||
attachment: {
|
||||
attachment: fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
url: pngUrl,
|
||||
},
|
||||
}),
|
||||
noBackground: true,
|
||||
noBorder: true,
|
||||
url: pngUrl,
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
import { setupI18n } from '../../util/setupI18n';
|
||||
import enMessages from '../../../_locales/en/messages.json';
|
||||
import { pngUrl, squareStickerUrl } from '../../storybook/Fixtures';
|
||||
import { fakeAttachment } from '../../test-both/helpers/fakeAttachment';
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
@@ -26,13 +27,13 @@ const story = storiesOf('Components/Conversation/ImageGrid', module);
|
||||
|
||||
const createProps = (overrideProps: Partial<Props> = {}): Props => ({
|
||||
attachments: overrideProps.attachments || [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
}),
|
||||
],
|
||||
bottomOverlay: boolean('bottomOverlay', overrideProps.bottomOverlay || false),
|
||||
i18n,
|
||||
@@ -60,20 +61,20 @@ story.add('One Image', () => {
|
||||
story.add('Two Images', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_JPEG,
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
height: 1680,
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
width: 3000,
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
@@ -83,27 +84,27 @@ story.add('Two Images', () => {
|
||||
story.add('Three Images', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_JPEG,
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
height: 1680,
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
width: 3000,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
@@ -113,34 +114,34 @@ story.add('Three Images', () => {
|
||||
story.add('Four Images', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_JPEG,
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
height: 1680,
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
width: 3000,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_JPEG,
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
height: 1680,
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
width: 3000,
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
@@ -150,41 +151,41 @@ story.add('Four Images', () => {
|
||||
story.add('Five Images', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_JPEG,
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
height: 1680,
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
width: 3000,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_JPEG,
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
height: 1680,
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
width: 3000,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
@@ -194,55 +195,55 @@ story.add('Five Images', () => {
|
||||
story.add('6+ Images', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_JPEG,
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
height: 1680,
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
width: 3000,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_JPEG,
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
height: 1680,
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
width: 3000,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
@@ -251,7 +252,7 @@ story.add('6+ Images', () => {
|
||||
story.add('Mixed Content Types', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: VIDEO_MP4,
|
||||
fileName: 'pixabay-Soap-Bubble-7141.mp4',
|
||||
height: 112,
|
||||
@@ -264,24 +265,24 @@ story.add('Mixed Content Types', () => {
|
||||
},
|
||||
url: '/fixtures/pixabay-Soap-Bubble-7141.mp4',
|
||||
width: 112,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'sax.png',
|
||||
height: 1200,
|
||||
url: pngUrl,
|
||||
width: 800,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: stringToMIMEType('text/plain'),
|
||||
fileName: 'lorem-ipsum.txt',
|
||||
url: '/fixtures/lorem-ipsum.txt',
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
contentType: AUDIO_MP3,
|
||||
fileName: 'incompetech-com-Agnus-Dei-X.mp3',
|
||||
url: '/fixtures/incompetech-com-Agnus-Dei-X.mp3',
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
@@ -291,13 +292,13 @@ story.add('Mixed Content Types', () => {
|
||||
story.add('Sticker', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: IMAGE_WEBP,
|
||||
fileName: 'sticker.webp',
|
||||
height: 512,
|
||||
url: squareStickerUrl,
|
||||
width: 512,
|
||||
},
|
||||
}),
|
||||
],
|
||||
isSticker: true,
|
||||
stickerSize: 128,
|
||||
|
||||
@@ -28,6 +28,8 @@ import enMessages from '../../../_locales/en/messages.json';
|
||||
import { pngUrl } from '../../storybook/Fixtures';
|
||||
import { getDefaultConversation } from '../../test-both/helpers/getDefaultConversation';
|
||||
|
||||
import { fakeAttachment } from '../../test-both/helpers/fakeAttachment';
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
function getJoyReaction() {
|
||||
@@ -444,13 +446,13 @@ story.add('Avatar in Group', () => {
|
||||
story.add('Sticker', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
url: '/fixtures/512x515-thumbs-up-lincoln.webp',
|
||||
fileName: '512x515-thumbs-up-lincoln.webp',
|
||||
contentType: IMAGE_WEBP,
|
||||
width: 128,
|
||||
height: 128,
|
||||
},
|
||||
}),
|
||||
],
|
||||
isSticker: true,
|
||||
status: 'sent',
|
||||
@@ -524,13 +526,13 @@ story.add('Link Preview', () => {
|
||||
previews: [
|
||||
{
|
||||
domain: 'signal.org',
|
||||
image: {
|
||||
image: fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'the-sax.png',
|
||||
height: 240,
|
||||
url: pngUrl,
|
||||
width: 320,
|
||||
},
|
||||
}),
|
||||
isStickerPack: false,
|
||||
title: 'Signal',
|
||||
description:
|
||||
@@ -551,13 +553,13 @@ story.add('Link Preview with Small Image', () => {
|
||||
previews: [
|
||||
{
|
||||
domain: 'signal.org',
|
||||
image: {
|
||||
image: fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'the-sax.png',
|
||||
height: 50,
|
||||
url: pngUrl,
|
||||
width: 50,
|
||||
},
|
||||
}),
|
||||
isStickerPack: false,
|
||||
title: 'Signal',
|
||||
description:
|
||||
@@ -639,13 +641,13 @@ story.add('Link Preview with small image, long description', () => {
|
||||
previews: [
|
||||
{
|
||||
domain: 'signal.org',
|
||||
image: {
|
||||
image: fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'the-sax.png',
|
||||
height: 50,
|
||||
url: pngUrl,
|
||||
width: 50,
|
||||
},
|
||||
}),
|
||||
isStickerPack: false,
|
||||
title: 'Signal',
|
||||
description: Array(10)
|
||||
@@ -669,13 +671,13 @@ story.add('Link Preview with no date', () => {
|
||||
previews: [
|
||||
{
|
||||
domain: 'signal.org',
|
||||
image: {
|
||||
image: fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'the-sax.png',
|
||||
height: 240,
|
||||
url: pngUrl,
|
||||
width: 320,
|
||||
},
|
||||
}),
|
||||
isStickerPack: false,
|
||||
title: 'Signal',
|
||||
description:
|
||||
@@ -695,13 +697,13 @@ story.add('Link Preview with too new a date', () => {
|
||||
previews: [
|
||||
{
|
||||
domain: 'signal.org',
|
||||
image: {
|
||||
image: fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'the-sax.png',
|
||||
height: 240,
|
||||
url: pngUrl,
|
||||
width: 320,
|
||||
},
|
||||
}),
|
||||
isStickerPack: false,
|
||||
title: 'Signal',
|
||||
description:
|
||||
@@ -720,13 +722,13 @@ story.add('Link Preview with too new a date', () => {
|
||||
story.add('Image', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
contentType: IMAGE_JPEG,
|
||||
width: 128,
|
||||
height: 128,
|
||||
},
|
||||
}),
|
||||
],
|
||||
status: 'sent',
|
||||
});
|
||||
@@ -738,41 +740,41 @@ for (let i = 2; i <= 5; i += 1) {
|
||||
story.add(`Multiple Images x${i}`, () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
contentType: IMAGE_JPEG,
|
||||
width: 128,
|
||||
height: 128,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
contentType: IMAGE_JPEG,
|
||||
width: 128,
|
||||
height: 128,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
contentType: IMAGE_JPEG,
|
||||
width: 128,
|
||||
height: 128,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
contentType: IMAGE_JPEG,
|
||||
width: 128,
|
||||
height: 128,
|
||||
},
|
||||
{
|
||||
}),
|
||||
fakeAttachment({
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
contentType: IMAGE_JPEG,
|
||||
width: 128,
|
||||
height: 128,
|
||||
},
|
||||
}),
|
||||
].slice(0, i),
|
||||
status: 'sent',
|
||||
});
|
||||
@@ -784,13 +786,13 @@ for (let i = 2; i <= 5; i += 1) {
|
||||
story.add('Image with Caption', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
contentType: IMAGE_JPEG,
|
||||
width: 128,
|
||||
height: 128,
|
||||
},
|
||||
}),
|
||||
],
|
||||
status: 'sent',
|
||||
text: 'This is my home.',
|
||||
@@ -802,14 +804,14 @@ story.add('Image with Caption', () => {
|
||||
story.add('GIF', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: VIDEO_MP4,
|
||||
flags: SignalService.AttachmentPointer.Flags.GIF,
|
||||
fileName: 'cat-gif.mp4',
|
||||
url: '/fixtures/cat-gif.mp4',
|
||||
width: 400,
|
||||
height: 332,
|
||||
},
|
||||
}),
|
||||
],
|
||||
status: 'sent',
|
||||
});
|
||||
@@ -820,14 +822,14 @@ story.add('GIF', () => {
|
||||
story.add('GIF in a group', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: VIDEO_MP4,
|
||||
flags: SignalService.AttachmentPointer.Flags.GIF,
|
||||
fileName: 'cat-gif.mp4',
|
||||
url: '/fixtures/cat-gif.mp4',
|
||||
width: 400,
|
||||
height: 332,
|
||||
},
|
||||
}),
|
||||
],
|
||||
conversationType: 'group',
|
||||
status: 'sent',
|
||||
@@ -839,7 +841,7 @@ story.add('GIF in a group', () => {
|
||||
story.add('Not Downloaded GIF', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: VIDEO_MP4,
|
||||
flags: SignalService.AttachmentPointer.Flags.GIF,
|
||||
fileName: 'cat-gif.mp4',
|
||||
@@ -847,7 +849,7 @@ story.add('Not Downloaded GIF', () => {
|
||||
blurHash: 'LDA,FDBnm+I=p{tkIUI;~UkpELV]',
|
||||
width: 400,
|
||||
height: 332,
|
||||
},
|
||||
}),
|
||||
],
|
||||
status: 'sent',
|
||||
});
|
||||
@@ -858,7 +860,7 @@ story.add('Not Downloaded GIF', () => {
|
||||
story.add('Pending GIF', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
pending: true,
|
||||
contentType: VIDEO_MP4,
|
||||
flags: SignalService.AttachmentPointer.Flags.GIF,
|
||||
@@ -867,7 +869,7 @@ story.add('Pending GIF', () => {
|
||||
blurHash: 'LDA,FDBnm+I=p{tkIUI;~UkpELV]',
|
||||
width: 400,
|
||||
height: 332,
|
||||
},
|
||||
}),
|
||||
],
|
||||
status: 'sent',
|
||||
});
|
||||
@@ -881,11 +883,11 @@ story.add('Audio', () => {
|
||||
|
||||
const messageProps = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: AUDIO_MP3,
|
||||
fileName: 'incompetech-com-Agnus-Dei-X.mp3',
|
||||
url: '/fixtures/incompetech-com-Agnus-Dei-X.mp3',
|
||||
},
|
||||
}),
|
||||
],
|
||||
...(isPlayed
|
||||
? {
|
||||
@@ -923,11 +925,11 @@ story.add('Audio', () => {
|
||||
story.add('Long Audio', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: AUDIO_MP3,
|
||||
fileName: 'long-audio.mp3',
|
||||
url: '/fixtures/long-audio.mp3',
|
||||
},
|
||||
}),
|
||||
],
|
||||
status: 'sent',
|
||||
});
|
||||
@@ -938,11 +940,11 @@ story.add('Long Audio', () => {
|
||||
story.add('Audio with Caption', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: AUDIO_MP3,
|
||||
fileName: 'incompetech-com-Agnus-Dei-X.mp3',
|
||||
url: '/fixtures/incompetech-com-Agnus-Dei-X.mp3',
|
||||
},
|
||||
}),
|
||||
],
|
||||
status: 'sent',
|
||||
text: 'This is what I sound like.',
|
||||
@@ -954,10 +956,10 @@ story.add('Audio with Caption', () => {
|
||||
story.add('Audio with Not Downloaded Attachment', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: AUDIO_MP3,
|
||||
fileName: 'incompetech-com-Agnus-Dei-X.mp3',
|
||||
},
|
||||
}),
|
||||
],
|
||||
status: 'sent',
|
||||
});
|
||||
@@ -968,11 +970,11 @@ story.add('Audio with Not Downloaded Attachment', () => {
|
||||
story.add('Audio with Pending Attachment', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: AUDIO_MP3,
|
||||
fileName: 'incompetech-com-Agnus-Dei-X.mp3',
|
||||
pending: true,
|
||||
},
|
||||
}),
|
||||
],
|
||||
status: 'sent',
|
||||
});
|
||||
@@ -983,11 +985,11 @@ story.add('Audio with Pending Attachment', () => {
|
||||
story.add('Other File Type', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: stringToMIMEType('text/plain'),
|
||||
fileName: 'my-resume.txt',
|
||||
url: 'my-resume.txt',
|
||||
},
|
||||
}),
|
||||
],
|
||||
status: 'sent',
|
||||
});
|
||||
@@ -998,11 +1000,11 @@ story.add('Other File Type', () => {
|
||||
story.add('Other File Type with Caption', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: stringToMIMEType('text/plain'),
|
||||
fileName: 'my-resume.txt',
|
||||
url: 'my-resume.txt',
|
||||
},
|
||||
}),
|
||||
],
|
||||
status: 'sent',
|
||||
text: 'This is what I have done.',
|
||||
@@ -1014,12 +1016,12 @@ story.add('Other File Type with Caption', () => {
|
||||
story.add('Other File Type with Long Filename', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: stringToMIMEType('text/plain'),
|
||||
fileName:
|
||||
'INSERT-APP-NAME_INSERT-APP-APPLE-ID_AppStore_AppsGamesWatch.psd.zip',
|
||||
url: 'a2/a2334324darewer4234',
|
||||
},
|
||||
}),
|
||||
],
|
||||
status: 'sent',
|
||||
text: 'This is what I have done.',
|
||||
@@ -1031,13 +1033,13 @@ story.add('Other File Type with Long Filename', () => {
|
||||
story.add('TapToView Image', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
contentType: IMAGE_JPEG,
|
||||
width: 128,
|
||||
height: 128,
|
||||
},
|
||||
}),
|
||||
],
|
||||
isTapToView: true,
|
||||
status: 'sent',
|
||||
@@ -1049,13 +1051,13 @@ story.add('TapToView Image', () => {
|
||||
story.add('TapToView Video', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: VIDEO_MP4,
|
||||
fileName: 'pixabay-Soap-Bubble-7141.mp4',
|
||||
height: 128,
|
||||
url: '/fixtures/pixabay-Soap-Bubble-7141.mp4',
|
||||
width: 128,
|
||||
},
|
||||
}),
|
||||
],
|
||||
isTapToView: true,
|
||||
status: 'sent',
|
||||
@@ -1067,14 +1069,14 @@ story.add('TapToView Video', () => {
|
||||
story.add('TapToView GIF', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: VIDEO_MP4,
|
||||
flags: SignalService.AttachmentPointer.Flags.GIF,
|
||||
fileName: 'cat-gif.mp4',
|
||||
url: '/fixtures/cat-gif.mp4',
|
||||
width: 400,
|
||||
height: 332,
|
||||
},
|
||||
}),
|
||||
],
|
||||
isTapToView: true,
|
||||
status: 'sent',
|
||||
@@ -1086,13 +1088,13 @@ story.add('TapToView GIF', () => {
|
||||
story.add('TapToView Expired', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
contentType: IMAGE_JPEG,
|
||||
width: 128,
|
||||
height: 128,
|
||||
},
|
||||
}),
|
||||
],
|
||||
isTapToView: true,
|
||||
isTapToViewExpired: true,
|
||||
@@ -1105,13 +1107,13 @@ story.add('TapToView Expired', () => {
|
||||
story.add('TapToView Error', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
contentType: IMAGE_JPEG,
|
||||
width: 128,
|
||||
height: 128,
|
||||
},
|
||||
}),
|
||||
],
|
||||
isTapToView: true,
|
||||
isTapToViewError: true,
|
||||
@@ -1124,13 +1126,13 @@ story.add('TapToView Error', () => {
|
||||
story.add('Dangerous File Type', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
contentType: stringToMIMEType(
|
||||
'application/vnd.microsoft.portable-executable'
|
||||
),
|
||||
fileName: 'terrible.exe',
|
||||
url: 'terrible.exe',
|
||||
},
|
||||
}),
|
||||
],
|
||||
status: 'sent',
|
||||
});
|
||||
@@ -1174,13 +1176,13 @@ story.add('@Mentions', () => {
|
||||
story.add('All the context menus', () => {
|
||||
const props = createProps({
|
||||
attachments: [
|
||||
{
|
||||
fakeAttachment({
|
||||
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
|
||||
fileName: 'tina-rolf-269345-unsplash.jpg',
|
||||
contentType: IMAGE_JPEG,
|
||||
width: 128,
|
||||
height: 128,
|
||||
},
|
||||
}),
|
||||
],
|
||||
status: 'partial-sent',
|
||||
canDeleteForEveryone: true,
|
||||
@@ -1194,13 +1196,13 @@ story.add('Not approved, with link preview', () => {
|
||||
previews: [
|
||||
{
|
||||
domain: 'signal.org',
|
||||
image: {
|
||||
image: fakeAttachment({
|
||||
contentType: IMAGE_PNG,
|
||||
fileName: 'the-sax.png',
|
||||
height: 240,
|
||||
url: pngUrl,
|
||||
width: 320,
|
||||
},
|
||||
}),
|
||||
isStickerPack: false,
|
||||
title: 'Signal',
|
||||
description:
|
||||
|
||||
@@ -33,6 +33,7 @@ const createAttachment = (
|
||||
),
|
||||
fileName: text('attachment fileName', props.fileName || ''),
|
||||
url: '',
|
||||
size: 14243,
|
||||
});
|
||||
|
||||
story.add('Text File', () => {
|
||||
|
||||
@@ -32,6 +32,7 @@ const createAttachment = (
|
||||
),
|
||||
fileName: text('attachment fileName', props.fileName || ''),
|
||||
url: text('attachment url', props.url || ''),
|
||||
size: 24325,
|
||||
});
|
||||
|
||||
const createProps = (overrideProps: Partial<Props> = {}): Props => ({
|
||||
|
||||
Reference in New Issue
Block a user