Adds error states to story images

This commit is contained in:
Josh Perez 2022-08-03 20:38:41 -04:00 committed by GitHub
parent 782838c591
commit fcf7406dd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 158 additions and 21 deletions

View file

@ -27,6 +27,7 @@ function getDefaultProps(): PropsType {
url: '/fixtures/nathan-anderson-316188-unsplash.jpg',
thumbnail: fakeThumbnail('/fixtures/nathan-anderson-316188-unsplash.jpg'),
}),
firstName: 'Charlie',
i18n,
label: 'A story',
queueStoryDownload: action('queueStoryDownload'),
@ -129,3 +130,39 @@ export const Video = (): JSX.Element => (
})}
/>
);
export const ErrorImage = (): JSX.Element => (
<StoryImage
{...getDefaultProps()}
attachment={fakeAttachment({
error: true,
url: '/this/path/does/not/exist.jpg',
})}
/>
);
export const ErrorImageThumbnail = (): JSX.Element => (
<StoryImage
{...getDefaultProps()}
attachment={fakeAttachment({
error: true,
url: '/this/path/does/not/exist.jpg',
})}
isThumbnail
/>
);
ErrorImageThumbnail.story = {
name: 'Error Image (thumbnail)',
};
export const ErrorImageYou = (): JSX.Element => (
<StoryImage
{...getDefaultProps()}
isMe
attachment={fakeAttachment({
error: true,
url: '/this/path/does/not/exist.jpg',
})}
/>
);