Skip to content

Commit 59883c2

Browse files
committed
Format all code
1 parent 7145840 commit 59883c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1299
-1618
lines changed

.github/CONTRIBUTING.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ welcome, from issue reports to PRs and documentation / write-ups.
55

66
Before you open a PR:
77

8-
* If you're planning to add or change a major feature in a PR, please ensure
9-
the change is aligned with the project roadmap by opening an issue first,
10-
especially if you're going to spend a lot of time on it.
11-
* In development, run `yarn start` to build (+watch) the project source, and run
12-
the [development server](http://localhost:8000).
13-
* Please ensure all the examples work correctly after your change. If you're
14-
adding a major new use-case, add a new example demonstrating its use.
15-
* Please **DO NOT** commit the build files. Make sure **ONLY** your changes to
16-
`/src/` and `/examples/src` are included in your PR.
17-
* Be careful to follow the code style of the project. Run `yarn run lint` after
18-
your changes and ensure you do not introduce any new errors or warnings.
19-
* All new features and changes need documentation.
20-
* Make sure yarn.lock is updated when you add or upgrade dependencies.
8+
- If you're planning to add or change a major feature in a PR, please ensure
9+
the change is aligned with the project roadmap by opening an issue first,
10+
especially if you're going to spend a lot of time on it.
11+
- In development, run `yarn start` to build (+watch) the project source, and run
12+
the [development server](http://localhost:8000).
13+
- Please ensure all the examples work correctly after your change. If you're
14+
adding a major new use-case, add a new example demonstrating its use.
15+
- Please **DO NOT** commit the build files. Make sure **ONLY** your changes to
16+
`/src/` and `/examples/src` are included in your PR.
17+
- Be careful to follow the code style of the project. Run `yarn run lint` after
18+
your changes and ensure you do not introduce any new errors or warnings.
19+
- All new features and changes need documentation.
20+
- Make sure yarn.lock is updated when you add or upgrade dependencies.

.github/HISTORY.md

+80-49
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# React-Images
22

33
### v1.0.0 / 2019-06-05
4+
45
- v1 release
56

67
### v0.5.19 / 2018-07-19
8+
79
- Fix babel lib output not transpiling
810

911
### v0.5.18 / 2018-07-19
12+
1013
- LightBox srcSet support for string and array #236 thanks to [lordoffreaks](https://github.com/lordoffreaks)
1114
- Upgrade react-transition-group to v2 #238 thanks to [filipecosta01](https://github.com/filipecosta01)
1215
- Add zindex to close button to bring it in front of spinner #225 thanks to [seanpascoe](https://github.com/seanpascoe)
@@ -15,148 +18,176 @@
1518
- Fix Lightbox srcSet prop type validation #209 thanks to [kripod](https://github.com/kripod)
1619

1720
### v0.5.17 / 2018-02-07
21+
1822
- fix for "srcSet" inconsistency #204 thanks to [kripod](https://github.com/kripod) and [wmertens](https://github.com/wmertens)
1923
- fix for preload bug when mounted with `isOpen` set to true thanks to [mkalygin](https://github.com/mkalygin)
2024
- removed `react-spinners` dependency which was bloating the bundle, and implemented a simple loading component, thanks [kripod](https://github.com/kripod)
2125
- support for conditional ScrollLock via new property `preventScroll` thanks to [Josh-a-e](https://github.com/Josh-a-e)
2226

2327
### v0.5.16 / 2018-01-30
28+
2429
- add preloadImage call to componentDidMount PR #200 thanks to [ilker0](https://github.com/ilker0)
2530
- Changes some docs to clarify that yarn is the preferred package manager for this project. Removes package-lock.json. PR #191 Thanks to [jorrit](https://github.com/jorrit)
26-
- Unmount the component tree before removing the portal node from DOM PR #180 thanks to [pleunv](https://github.com/pleunv)
31+
- Unmount the component tree before removing the portal node from DOM PR #180 thanks to [pleunv](https://github.com/pleunv)
2732
- Fix react warnings by updating react-scrolllock version [jorrit](https://github.com/jorrit))
2833

2934
### v0.5.15 / 2018-01-25
35+
3036
- spinner functionality pull request #187 thanks to [mkalygin](https://github.com/mkalygin)
3137

3238
### v0.5.13 / 2017-11-29
39+
3340
- change srcset to srcSet to fix intermittent warning: Invalid DOM property `srcset`. Did you mean `srcSet`?
3441

3542
### v0.5.12 / 2017-11-29
36-
- Fix React warning issue #171 thanks to [kachkaev](https://github.com/kachkaev)
43+
44+
- Fix React warning issue #171 thanks to [kachkaev](https://github.com/kachkaev)
3745

3846
### v0.5.10 / 2017-10-18
47+
3948
- New build
4049

4150
### v0.5.8 / 2017-10-06
51+
4252
- Incorrect peer dependency in package.json file
4353

4454
### v0.5.7 / 2017-10-04
55+
4556
- Fix warnings for React 16.0.0 and update dependencies
4657

4758
### v0.5.6 / 2017-09-20
59+
4860
- Update: Let user pass in srcSet as prop in addition to srcset thanks to [smeijer](https://github.com/smeijer)
4961
- Fix: default arrow bg color is none
5062
- Fix: make content div, figure, image respond to theme props #127
5163
- Fix: caption extending and disabling backdropClosesModal click issue #156
5264
- Fix: alignment in safari issue #105
5365

5466
### v0.5.5 / 2017-07-28
67+
5568
- Fix: let user override all possible properties with theme object thanks to [clintharris](https://github.com/clintharris)
5669
- Fix: clicking on image closes lightbox when backdropClosesModal is set to true #152
5770
- Fix: clicking close lightbox button fired onClose handler twice #155
5871

5972
### v0.5.4 / 2017-05-31
73+
6074
- Update: separate out prop-types for React 16 thanks to [hiyamamo](https:github.com/hiyamamo)
6175
- Update: update react-addons-css-transition-group to react-transition-group thanks to [neptunian](https://github.com/neptunian)
6276
- Fix: React warnings in React v15.5.0
6377

6478
### v0.5.2 / 2016-11-17
79+
6580
- Fix: keydown listeners thanks to [aknuds1](https:github.com/aknuds1) [archr](https:github.com/archr)
6681
- Fix: thumbnail click propagation thanks to [GregoryPotdevin](https://github.com/GregoryPotdevin)
6782
- Update: use abstracted ScrollLock component
6883

6984
### v0.5.1 / 2016-08-21
70-
* Feature: Support theming with aphrodite classes
71-
* Examples: Update options with new new prop details
85+
86+
- Feature: Support theming with aphrodite classes
87+
- Examples: Update options with new new prop details
7288

7389
### v0.5.0 / 2016-08-20
74-
* Feature: Added a thumbnail preview beneath the lightbox thanks to [GregoryPotdevin](https://github.com/GregoryPotdevin)
75-
* Feature: Re-implemented the layout using `flexbox`
76-
* Examples: Replaced local images with hot-linked Unsplash photographs
7790

78-
* * *
91+
- Feature: Added a thumbnail preview beneath the lightbox thanks to [GregoryPotdevin](https://github.com/GregoryPotdevin)
92+
- Feature: Re-implemented the layout using `flexbox`
93+
- Examples: Replaced local images with hot-linked Unsplash photographs
94+
95+
---
7996

8097
### v0.4.11 / 2016-08-15
81-
* Feature: Pre-load the next image based on user intention, uses new prop `preloadNextImage`
82-
* Fix: bug with `enableKeyboardInput` where images fail to render thanks to [benhowell](https://github.com/benhowell)
83-
* Bump dev dependencies for `react` and `react-dom` to `15.3.0`
84-
* Increase the default max-width of the Lightbox to `1024px`
98+
99+
- Feature: Pre-load the next image based on user intention, uses new prop `preloadNextImage`
100+
- Fix: bug with `enableKeyboardInput` where images fail to render thanks to [benhowell](https://github.com/benhowell)
101+
- Bump dev dependencies for `react` and `react-dom` to `15.3.0`
102+
- Increase the default max-width of the Lightbox to `1024px`
85103

86104
### v0.4.10 / 2016-08-11
87-
* Fix react PropTypes warning. See [fixing-the-false-positive](https://facebook.github.io/react/warnings/dont-call-proptypes.html#fixing-the-false-positive-in-third-party-proptypes)
88-
* Simplify fade transition using `react-css-addons-transition-group`
105+
106+
- Fix react PropTypes warning. See [fixing-the-false-positive](https://facebook.github.io/react/warnings/dont-call-proptypes.html#fixing-the-false-positive-in-third-party-proptypes)
107+
- Simplify fade transition using `react-css-addons-transition-group`
89108

90109
### v0.4.9 / 2016-07-28
91-
* Resolve react "no-unused-prop" warnings [benhowell](https://github.com/benhowell)
110+
111+
- Resolve react "no-unused-prop" warnings [benhowell](https://github.com/benhowell)
92112

93113
### v0.4.7 / 2016-07-14
94-
* Custom controls thanks to [robintail](https://github.com/robintail)
95-
* dependency fix for `react-addons-transition-group` thanks to [fend25](https://github.com/fend25)
114+
115+
- Custom controls thanks to [robintail](https://github.com/robintail)
116+
- dependency fix for `react-addons-transition-group` thanks to [fend25](https://github.com/fend25)
96117

97118
### v0.4.6 / 2016-05-17
98-
* General cleanup
119+
120+
- General cleanup
99121

100122
### v0.4.5 / 2016-05-16
101-
* Added `imageCountSeparator` prop to replace " of " in the image count
123+
124+
- Added `imageCountSeparator` prop to replace " of " in the image count
102125

103126
### v0.4.4 / 2016-05-16
104-
* Account for scrollbar width when opening/closing the lightbox
105-
* Remove required flag on `onClickNext` and `onClickPrev` - may only render a single image
106-
* Increase dialog z-index to `2001` thanks to [newsiberian](https://github.com/newsiberian)
127+
128+
- Account for scrollbar width when opening/closing the lightbox
129+
- Remove required flag on `onClickNext` and `onClickPrev` - may only render a single image
130+
- Increase dialog z-index to `2001` thanks to [newsiberian](https://github.com/newsiberian)
107131

108132
### v0.4.3 / 2016-05-16
109-
* Resolve peer-dependency issues thanks to [jedwatson](https://github.com/jedwatson)
133+
134+
- Resolve peer-dependency issues thanks to [jedwatson](https://github.com/jedwatson)
110135

111136
### v0.4.2 / 2016-05-14
112-
* Update dependencies
137+
138+
- Update dependencies
113139

114140
### v0.4.1 / 2016-05-12
115-
* Update peer dependencies
141+
142+
- Update peer dependencies
116143

117144
### v0.4.0 / 2016-05-12
118-
* Bump all applicable dependencies
119-
* Remove peer dependencies
120145

121-
* * *
146+
- Bump all applicable dependencies
147+
- Remove peer dependencies
148+
149+
---
122150

123151
### v0.3.3 / 2016-05-12
124-
* Updated website with more info + new design
125-
* Introduction of `onClickImage` prop thanks to [pradel](https://github.com/pradel)
126-
* Documentation for `showImageCount` thanks to [neptunian](https://github.com/neptunian)
152+
153+
- Updated website with more info + new design
154+
- Introduction of `onClickImage` prop thanks to [pradel](https://github.com/pradel)
155+
- Documentation for `showImageCount` thanks to [neptunian](https://github.com/neptunian)
127156

128157
### v0.3.2 / 2016-01-20
129-
* Fix backdropClosesModal behaviour
130-
* Update defaults: backdropClosesModal `false`, showCloseButton `true`
158+
159+
- Fix backdropClosesModal behaviour
160+
- Update defaults: backdropClosesModal `false`, showCloseButton `true`
131161

132162
### v0.3.1 / 2016-01-15
133-
* Updated react dependencies
134-
* Better handling of lightbox positioning
163+
164+
- Updated react dependencies
165+
- Better handling of lightbox positioning
135166

136167
### v0.3.0 / 2016-01-06
137168

138-
* Update to use ES6
139-
* Update to use JSS
140-
* Layout refactor:
141-
- Moved away from CSS transforms for centering
142-
- Improved responsiveness, performance
143-
* Update example images to Gratisography
144-
* Optional captions below images thanks to [@ko](https://github.com/ko)
145-
* Optional count below images e.g. "3 of 12"
146-
* Move close button top right of frame, and replace with × icon
169+
- Update to use ES6
170+
- Update to use JSS
171+
- Layout refactor:
172+
- Moved away from CSS transforms for centering
173+
- Improved responsiveness, performance
174+
- Update example images to Gratisography
175+
- Optional captions below images thanks to [@ko](https://github.com/ko)
176+
- Optional count below images e.g. "3 of 12"
177+
- Move close button top right of frame, and replace with × icon
147178

148-
* * *
179+
---
149180

150181
### v0.2.1 / 2015-11-29
151182

152-
* Fix bug in examples with `goto` functions
183+
- Fix bug in examples with `goto` functions
153184

154185
### v0.2.0 / 2015-11-29
155186

156-
* Make the component stateless, now uses functions `onClickPrev`/`onClickNext`
187+
- Make the component stateless, now uses functions `onClickPrev`/`onClickNext`
157188

158-
* * *
189+
---
159190

160191
### v0.1.0 / 2015-11-20
161192

162-
* Support for `srcset` thanks to [@neptunian](https://github.com/neptunian)
193+
- Support for `srcset` thanks to [@neptunian](https://github.com/neptunian)

.github/PULL_REQUEST_TEMPLATE.md

-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66

77
**Description of changes:**
88

9-
109
**Related issues (if any):**
1110

12-
1311
**Checks:**
1412

1513
- [ ] Please confirm `yarn run lint` ran successfully

.github/workflows/main.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: CI
22
on: [push, pull_request]
3+
34
jobs:
45
lint:
56
name: ✔️ Lint
@@ -12,10 +13,25 @@ jobs:
1213
- uses: borales/actions-yarn@v2.0.0
1314
with:
1415
cmd: run lint
16+
17+
check-formatting:
18+
name: ✔️ Lint
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v1
22+
- uses: borales/actions-yarn@v2.0.0
23+
with:
24+
cmd: install
25+
- uses: borales/actions-yarn@v2.0.0
26+
with:
27+
cmd: run format:check
28+
1529
build:
1630
name: 🛠️ Build
1731
runs-on: ubuntu-latest
18-
needs: lint
32+
needs:
33+
- lint
34+
- check-formatting
1935
steps:
2036
- uses: actions/checkout@v1
2137
- uses: borales/actions-yarn@v2.0.0

README.md

+16-13
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
**Don't use this in a new project.** This package hasn't been properly maintained in a long time and there are much better options available.
66

77
**Instead, try...**
8+
89
- [React Responsive Carousel](http://react-responsive-carousel.js.org/)
910

1011
---
@@ -22,7 +23,9 @@ Start by installing `react-images`
2223
```bash
2324
npm install react-images
2425
```
26+
2527
or
28+
2629
```bash
2730
yarn add react-images
2831
```
@@ -38,14 +41,14 @@ Import the carousel from `react-images` at the top of a
3841
component and then use it in the render function.
3942

4043
```jsx
41-
import React from 'react';
42-
import Carousel from 'react-images';
44+
import React from 'react'
45+
import Carousel from 'react-images'
4346

44-
const images = [{ source: 'path/to/image-1.jpg' }, { source: 'path/to/image-2.jpg' }];
47+
const images = [{ source: 'path/to/image-1.jpg' }, { source: 'path/to/image-2.jpg' }]
4548

4649
class Component extends React.Component {
4750
render() {
48-
return <Carousel views={images} />;
51+
return <Carousel views={images} />
4952
}
5053
}
5154
```
@@ -60,18 +63,18 @@ The `ModalGateway` will insert the modal just before the
6063
end of your `<body />` tag.
6164

6265
```jsx
63-
import React from 'react';
64-
import Carousel, { Modal, ModalGateway } from 'react-images';
66+
import React from 'react'
67+
import Carousel, { Modal, ModalGateway } from 'react-images'
6568

66-
const images = [{ source: 'path/to/image-1.jpg' }, { source: 'path/to/image-2.jpg' }];
69+
const images = [{ source: 'path/to/image-1.jpg' }, { source: 'path/to/image-2.jpg' }]
6770

6871
class Component extends React.Component {
69-
state = { modalIsOpen: false };
72+
state = { modalIsOpen: false }
7073
toggleModal = () => {
71-
this.setState(state => ({ modalIsOpen: !state.modalIsOpen }));
72-
};
74+
this.setState(state => ({ modalIsOpen: !state.modalIsOpen }))
75+
}
7376
render() {
74-
const { modalIsOpen } = this.state;
77+
const { modalIsOpen } = this.state
7578

7679
return (
7780
<ModalGateway>
@@ -81,7 +84,7 @@ class Component extends React.Component {
8184
</Modal>
8285
) : null}
8386
</ModalGateway>
84-
);
87+
)
8588
}
8689
}
8790
```
@@ -91,7 +94,7 @@ class Component extends React.Component {
9194
The simplest way to define a list of images for the carousel looks like:
9295

9396
```jsx
94-
const images = [{ source: 'path/to/image-1.jpg' }, { source: 'path/to/image-2.jpg' }];
97+
const images = [{ source: 'path/to/image-1.jpg' }, { source: 'path/to/image-2.jpg' }]
9598
```
9699

97100
However, react-images supports several other properties on each image object than just `source`. For example:

0 commit comments

Comments
 (0)