Fixed Avatar storyRing and blur on storybook

This commit is contained in:
Alvaro 2022-09-26 13:12:51 -06:00 committed by GitHub
parent 1aef9dadd7
commit a921f267f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -42,8 +42,9 @@ export default {
}, },
blur: { blur: {
control: { type: 'radio' }, control: { type: 'radio' },
defaultValue: AvatarBlur.NoBlur, defaultValue: undefined,
options: { options: {
Undefined: undefined,
NoBlur: AvatarBlur.NoBlur, NoBlur: AvatarBlur.NoBlur,
BlurPicture: AvatarBlur.BlurPicture, BlurPicture: AvatarBlur.BlurPicture,
BlurPictureWithClickToView: AvatarBlur.BlurPictureWithClickToView, BlurPictureWithClickToView: AvatarBlur.BlurPictureWithClickToView,
@ -79,7 +80,7 @@ const createProps = (overrideProps: Partial<Props> = {}): Props => ({
: true, : true,
avatarPath: overrideProps.avatarPath || '', avatarPath: overrideProps.avatarPath || '',
badge: overrideProps.badge, badge: overrideProps.badge,
blur: overrideProps.blur || AvatarBlur.NoBlur, blur: overrideProps.blur,
color: overrideProps.color || AvatarColors[0], color: overrideProps.color || AvatarColors[0],
conversationType: overrideProps.conversationType || 'direct', conversationType: overrideProps.conversationType || 'direct',
i18n, i18n,
@ -95,6 +96,7 @@ const createProps = (overrideProps: Partial<Props> = {}): Props => ({
size: 80, size: 80,
title: overrideProps.title || '', title: overrideProps.title || '',
theme: overrideProps.theme || ThemeType.light, theme: overrideProps.theme || ThemeType.light,
storyRing: overrideProps.storyRing,
}); });
const sizes = Object.values(AvatarSize).filter( const sizes = Object.values(AvatarSize).filter(
@ -238,6 +240,7 @@ BlurredBasedOnProps.args = createProps({
acceptedMessageRequest: false, acceptedMessageRequest: false,
avatarPath: '/fixtures/kitten-3-64-64.jpg', avatarPath: '/fixtures/kitten-3-64-64.jpg',
}); });
BlurredBasedOnProps.story = { BlurredBasedOnProps.story = {
name: 'Blurred based on props', name: 'Blurred based on props',
}; };