Center non-square avatar pictures

This commit is contained in:
Evan Hahn 2021-05-10 12:50:04 -05:00 committed by GitHub
parent 4b566e0a19
commit c68d65ea0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

BIN
fixtures/wide.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -29,6 +29,7 @@
}
&__image {
background-position: center center;
background-size: cover;
display: flex;
height: 100%;

View File

@ -64,6 +64,14 @@ story.add('Avatar', () => {
return sizes.map(size => <Avatar key={size} {...props} size={size} />);
});
story.add('Wide image', () => {
const props = createProps({
avatarPath: '/fixtures/wide.jpg',
});
return sizes.map(size => <Avatar key={size} {...props} size={size} />);
});
story.add('One-word Name', () => {
const props = createProps({
title: 'John',