diff --git a/webapp/components/_new/generic/UserAvatar/UserAvatar.story.js b/webapp/components/_new/generic/UserAvatar/UserAvatar.story.js
index 0748a6266..f68a4f2ec 100644
--- a/webapp/components/_new/generic/UserAvatar/UserAvatar.story.js
+++ b/webapp/components/_new/generic/UserAvatar/UserAvatar.story.js
@@ -4,6 +4,7 @@ import StoryRouter from 'storybook-vue-router'
import UserAvatar from '~/components/_new/generic/UserAvatar/UserAvatar'
import helpers from '~/storybook/helpers'
import { user } from '~/components/UserTeaser/UserTeaser.story.js'
+import imageFile from './storybook/critical-avatar-white-background.png'
helpers.init()
const anonymousUser = {
@@ -13,34 +14,46 @@ const anonymousUser = {
}
const userWithoutAvatar = {
...user,
- avatar: null,
name: 'Ana Paula Nunes Marques',
+ avatar: null,
+}
+const userWithAvatar = {
+ ...user,
+ name: 'Jochen Image',
+ avatar: { url: imageFile },
}
storiesOf('UserAvatar', module)
.addDecorator(withA11y)
.addDecorator(helpers.layout)
.addDecorator(StoryRouter())
- .add('with image', () => ({
+ .add('normal, with image', () => ({
components: { UserAvatar },
data: () => ({
- user,
+ user: userWithAvatar,
}),
template: '',
}))
- .add('without image, anonymous user', () => ({
+ .add('normal without image, anonymous user', () => ({
components: { UserAvatar },
data: () => ({
user: anonymousUser,
}),
template: '',
}))
- .add('without image, user initials', () => ({
+ .add('normal without image, user initials', () => ({
components: { UserAvatar },
data: () => ({
user: userWithoutAvatar,
}),
template: '',
}))
+ .add('small, with image', () => ({
+ components: { UserAvatar },
+ data: () => ({
+ user: userWithAvatar,
+ }),
+ template: '',
+ }))
.add('small', () => ({
components: { UserAvatar },
data: () => ({
@@ -48,6 +61,13 @@ storiesOf('UserAvatar', module)
}),
template: '',
}))
+ .add('large, with image', () => ({
+ components: { UserAvatar },
+ data: () => ({
+ user: userWithAvatar,
+ }),
+ template: '',
+ }))
.add('large', () => ({
components: { UserAvatar },
data: () => ({
diff --git a/webapp/components/_new/generic/UserAvatar/UserAvatar.vue b/webapp/components/_new/generic/UserAvatar/UserAvatar.vue
index 451d7648b..456c0572b 100644
--- a/webapp/components/_new/generic/UserAvatar/UserAvatar.vue
+++ b/webapp/components/_new/generic/UserAvatar/UserAvatar.vue
@@ -77,6 +77,7 @@ export default {
height: 100%;
object-fit: cover;
object-position: center;
+ background-color: $background-color-base;
}
}
diff --git a/webapp/components/_new/generic/UserAvatar/storybook/critical-avatar-white-background.png b/webapp/components/_new/generic/UserAvatar/storybook/critical-avatar-white-background.png
new file mode 100755
index 000000000..adfaa5a86
Binary files /dev/null and b/webapp/components/_new/generic/UserAvatar/storybook/critical-avatar-white-background.png differ