Center non-square avatar pictures

This commit is contained in:
Evan Hahn
2021-05-10 13:57:45 -05:00
committed by GitHub
parent 450a5408f1
commit a9149c870c
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

@@ -62,6 +62,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',