Skip to content

Commit

Permalink
fix: add aspect-ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
igordanchenko committed Dec 24, 2021
1 parent ad15381 commit b5080b0
Show file tree
Hide file tree
Showing 2 changed files with 664 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/PhotoDecorator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const PhotoDecorator = <T extends Photo = Photo>(props: PhotoDecoratorProps<T>)
display: "block",
height: "auto",
width: layoutOptions.layout === Layout.Rows ? cssWidth(layout, layoutOptions) : "100%",
aspectRatio: `${photo.width} / ${photo.height}`,
...(layoutOptions.padding ? { padding: `${layoutOptions.padding}px` } : null),
...((layoutOptions.layout === Layout.Columns || layoutOptions.layout === Layout.Masonry) &&
layout.photoIndex < layout.photosCount - 1
Expand Down
Loading

0 comments on commit b5080b0

Please sign in to comment.