react-photo-album
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -206,2 +206,5 @@ "use strict"; | ||
} | ||
function clsx(...classes) { | ||
return [...classes].filter((cls) => Boolean(cls)).join(" "); | ||
} | ||
function calcWidth(base, { width, photosCount }, { spacing, padding, containerWidth }) { | ||
@@ -236,3 +239,9 @@ const gaps = spacing * (photosCount - 1) + 2 * padding * photosCount; | ||
var _a, _b; | ||
const { photo, layout, layoutOptions, imageProps: { style, ...restImageProps } = {}, renderPhoto } = props; | ||
const { | ||
photo, | ||
layout, | ||
layoutOptions, | ||
imageProps: { style, className, ...restImageProps } = {}, | ||
renderPhoto | ||
} = props; | ||
const { onClick } = layoutOptions; | ||
@@ -259,3 +268,3 @@ const imageStyle = { | ||
style: imageStyle, | ||
className: "react-photo-album--photo", | ||
className: clsx("react-photo-album--photo", className), | ||
loading: "lazy", | ||
@@ -309,7 +318,7 @@ decoding: "async", | ||
renderRowContainer, | ||
rowContainerProps: { style, ...restRowContainerProps } = {}, | ||
rowContainerProps: { style, className, ...restRowContainerProps } = {}, | ||
children | ||
} = props; | ||
const rowContainerProps = { | ||
className: "react-photo-album--row", | ||
className: clsx("react-photo-album--row", className), | ||
style: { | ||
@@ -557,7 +566,7 @@ display: "flex", | ||
children, | ||
columnContainerProps: { style, ...restColumnContainerProps } = {}, | ||
columnContainerProps: { style, className, ...restColumnContainerProps } = {}, | ||
...rest | ||
} = props; | ||
const columnContainerProps = { | ||
className: "react-photo-album--column", | ||
className: clsx("react-photo-album--column", className), | ||
style: { | ||
@@ -688,6 +697,6 @@ display: "flex", | ||
containerRef, | ||
containerProps: { style, ...restContainerProps } = {} | ||
containerProps: { style, className, ...restContainerProps } = {} | ||
} = props; | ||
const containerProps = { | ||
className: `react-photo-album react-photo-album--${layout}`, | ||
className: clsx("react-photo-album", `react-photo-album--${layout}`, className), | ||
style: { | ||
@@ -694,0 +703,0 @@ display: "flex", |
{ | ||
"name": "react-photo-album", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "Responsive photo gallery component for React", | ||
@@ -5,0 +5,0 @@ "author": "Igor Danchenko", |
Sorry, the diff of this file is not supported yet
83554
1893
20216