Adds error states to story images
This commit is contained in:
parent
782838c591
commit
fcf7406dd4
12 changed files with 158 additions and 21 deletions
|
@ -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',
|
||||
})}
|
||||
/>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue