react-justified-layout-ts 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-justified-layout-ts",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "A component based off Flickr's justified layout that is compatible with Typescript",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -100,9 +100,8 @@ function TSJustifiedLayout({
100
100
  function renderRow(aspectRatio: ElementDimensions, isLastRow: boolean) {
101
101
  childNodeCounter++;
102
102
  return <div style={{
103
- maxHeight: '100%',
104
103
  aspectRatio: aspectRatio,
105
- ...(isLastRow ? {} : {flex: aspectRatio}),
104
+ flex: aspectRatio,
106
105
  ...containerStyle
107
106
  }}>
108
107
  {children[childNodeCounter]}
@@ -117,8 +116,7 @@ function TSJustifiedLayout({
117
116
  display: "flex",
118
117
  flexDirection: "row",
119
118
  gap: itemSpacing,
120
- marginBottom: rowSpacing,
121
- aspectRatio: width / value.height
119
+ marginBottom: rowSpacing
122
120
  }
123
121
  }>
124
122
  {value.items.map((aspectRatio) => renderRow(aspectRatio, isLastRow))}
@@ -1,3 +1,3 @@
1
1
  .justified-row img {
2
- height: 100%
2
+ width: 100%
3
3
  }
@@ -203,7 +203,7 @@ const displayedImages = [
203
203
  export const Primary: Story = {
204
204
  name: "Complex Elements",
205
205
  args: {
206
- width: 847,
206
+ width: 491,
207
207
  showWidows: true,
208
208
  targetRowHeight: undefined,
209
209
  rowSpacing: undefined,
@@ -212,7 +212,7 @@ export const Primary: Story = {
212
212
  targetRowHeightTolerance: undefined,
213
213
  children: displayedImages.map(value => <>
214
214
  <div style={{top: 16, left: 16, position: "absolute"}}>Testing</div>
215
- <img src={value.webp}/>
215
+ <img src={value.webp || value.src}/>
216
216
  </>
217
217
  ),
218
218
  containerStyle: {position: 'relative'}