Skip to content

Commit

Permalink
Merge pull request #183 from itoldya/v1
Browse files Browse the repository at this point in the history
Release v1.0.0
  • Loading branch information
itoldya authored Sep 13, 2022
2 parents edc11bd + a87aeee commit 6cba0a8
Show file tree
Hide file tree
Showing 70 changed files with 10,164 additions and 11,891 deletions.
8 changes: 7 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"presets": [
"@babel/preset-typescript",
"@babel/preset-env",
["@babel/preset-react", {
"runtime": "automatic"
}]
],
"plugins": []
}
41 changes: 0 additions & 41 deletions .github/workflows/pages.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ dist/
lib/
.publish
.DS_Store
.idea
.idea
.cache
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# react-grid-gallery
# CHANGELOG

The most recent changelog is available on the [releases page](https://github.com/benhowell/react-grid-gallery/releases).

### v0.5.6 / 2022-08-23

* Fixed grid breakdown when container width is decimal [#170](https://github.com/benhowell/react-grid-gallery/pull/170), closes [#84](https://github.com/benhowell/react-grid-gallery/issues/84)
* TypeScript declaration file added [#173](https://github.com/benhowell/react-grid-gallery/pull/173), closes [#145](https://github.com/benhowell/react-grid-gallery/issues/145)
* Added defaultContainerWidth option for SSR rendering support [#175](https://github.com/benhowell/react-grid-gallery/pull/175)

### v0.5.5 / 2019-06-20

Expand Down
205 changes: 72 additions & 133 deletions README.md

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions UPGRADE_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# From v0.5.x

The biggest change from v0.5.x to 1.x.x is that now this library has no lightbox functionality.
Read [this discussion](https://github.com/benhowell/react-grid-gallery/discussions/179) to learn more about the motivation for that decision.
So if you want need lightbox integration please check out our [examples](https://benhowell.github.io/react-grid-gallery/).

## API changes
Also, we made API polishing and renamed some props, and changed event handler signatures.

### Gallery Options changes
- `onSelectImage` renamed to `onSelect`
- `onClickThumbnail` renamed to `onClick`

Both event handlers now receive the same arguments:
```ts
(index: number, item: Image, event: MouseEvent<HTMLElement>) => void
```

Styling props such as `thumbnailStyle`, `tagStyle`, `tileViewportStyle` now get some extra data as arguments, read more in [the docs](https://github.com/benhowell/react-grid-gallery#gallery-options).

In [v0.5.x docs](https://github.com/benhowell/react-grid-gallery/tree/v0.5.6#programmers-notes) there was a hacky access to `this` in event handlers.
After lightbox functionality was stripped out it's not needed and removed.

In [v0.5.x](https://github.com/benhowell/react-grid-gallery/tree/v0.5.6), there was [hacky access](https://github.com/benhowell/react-grid-gallery/tree/v0.5.6#programmers-notes) to `this` in event handlers. After lightbox functionality was stripped out this hack was removed as well.

### Image Options changes
- `thumbnail` renamed to `src`
- `thumbnailWidth` renamed to `width`
- `thumbnailHeight` renamed to `height`

So now the minimum image object looks like this

```json
{
"src": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Apples.jpg/320px-Apples.jpg",
"width": 320,
"height": 480
}
```


## No default import

React grid gallery now uses only named export. Please update import to
```js
import { Gallery } from "react-grid-gallery";
```
Loading

0 comments on commit 6cba0a8

Please sign in to comment.