Manual download of attachments with no blurHash

This commit is contained in:
Josh Perez 2021-02-11 20:50:11 -05:00 committed by GitHub
parent ed786898fb
commit 34285054f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 117 additions and 32 deletions

View file

@ -10,6 +10,7 @@ import { storiesOf } from '@storybook/react';
import { pngUrl } from '../../storybook/Fixtures';
import { Image, Props } from './Image';
import { IMAGE_PNG } from '../../types/MIME';
import { ThemeType } from '../../types/Util';
import { setup as setupI18n } from '../../../js/modules/i18n';
import enMessages from '../../../_locales/en/messages.json';
@ -56,6 +57,7 @@ const createProps = (overrideProps: Partial<Props> = {}): Props => ({
),
softCorners: boolean('softCorners', overrideProps.softCorners || false),
tabIndex: number('tabIndex', overrideProps.tabIndex || 0),
theme: text('theme', overrideProps.theme || 'light') as ThemeType,
url: text('url', overrideProps.url || pngUrl),
width: number('width', overrideProps.width || 100),
});
@ -191,6 +193,32 @@ story.add('Blurhash', () => {
return <Image {...props} />;
});
story.add('undefined blurHash (light)', () => {
const defaultProps = createProps();
const props = {
...defaultProps,
blurHash: undefined,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
url: undefined as any,
theme: ThemeType.light,
};
return <Image {...props} />;
});
story.add('undefined blurHash (dark)', () => {
const defaultProps = createProps();
const props = {
...defaultProps,
blurHash: undefined,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
url: undefined as any,
theme: ThemeType.dark,
};
return <Image {...props} />;
});
story.add('Missing Image', () => {
const defaultProps = createProps();
const props = {