Skip to content

Commit 7dff85e

Browse files
committed
Rename package and publish
1 parent 290067b commit 7dff85e

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
React Lazy Load Image
2-
=====================
1+
React Lazy Load Image Component
2+
===============================
33

44
React Component to lazy load images using a HOC to track window scroll position.
55

@@ -17,45 +17,47 @@ React Component to lazy load images using a HOC to track window scroll position.
1717

1818
## Installation
1919

20-
1. Install react-lazy-load-image as a dependency:
20+
1. Install react-lazy-load-image-component as a dependency:
2121
```bash
2222
# Yarn
23-
$ yarn add react-lazy-load-image
23+
$ yarn add react-lazy-load-image-component
2424

2525
# NPM
26-
$ npm i --save react-lazy-load-image
26+
$ npm i --save react-lazy-load-image-component
2727
```
2828
2. Import the LazyLoadImage component:
2929
```javascript
30-
import { LazyLoadImage } from 'react-lazy-load-image'
30+
import { LazyLoadImage } from 'react-lazy-load-image-component'
3131
```
3232

3333
3. Import the trackWindowScroll HOC:
3434
```javascript
35-
import { trackWindowScroll } from 'react-lazy-load-image'
35+
import { trackWindowScroll } from 'react-lazy-load-image-component'
3636
```
3737

3838

3939
## Usage
4040

4141
```javascript
4242
import React from 'react';
43-
import { LazyLoadImage, trackWindowScroll } from 'react-lazy-load-image';
43+
import { LazyLoadImage, trackWindowScroll }
44+
from 'react-lazy-load-image-component';
4445

4546
const Gallery = ({ images, scrollPosition }) => (
4647
<div>
4748
{images.map((image) =>
4849
<LazyLoadImage
4950
key={image.key}
51+
alt={image.alt}
5052
height={image.height}
51-
scrollPosition={scrollPosition} // pass the scrollPosition to the image
53+
scrollPosition={scrollPosition} // pass the scrollPosition
5254
src={image.src} // use normal <img> attributes as props
5355
width={image.width} />
5456
)}
5557
</div>
5658
);
57-
// Wrap Gallery with trackWindowScroll HOC so it receives a scrollPosition prop
58-
// to pass down to the images
59+
// Wrap Gallery with trackWindowScroll HOC so it receives
60+
// a scrollPosition prop to pass down to the images
5961
export default trackWindowScroll(Gallery);
6062
```
6163

@@ -71,6 +73,8 @@ export default trackWindowScroll(Gallery);
7173
| ... | | Any other image attribute |
7274

7375

74-
## Screenshots
76+
## Screenshot
7577

76-
<a href="https://raw.githubusercontent.com/Aljullu/react-lazy-load-image/master/screenshots/example.gif"><img src="https://raw.githubusercontent.com/Aljullu/react-lazy-load-image/master/screenshots/example.gif" alt="" /></a>
78+
<a href="https://raw.githubusercontent.com/Aljullu/react-lazy-load-image-component/master/screenshots/example.gif"><img src="https://raw.githubusercontent.com/Aljullu/react-lazy-load-image-component/master/screenshots/example.gif" alt="" /></a>
79+
80+
Get the [full code of this example](https://github.com/Aljullu/weather-app).

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "react-lazy-load-image",
3-
"version": "0.0.1",
2+
"name": "react-lazy-load-image-component",
3+
"version": "1.0.0",
44
"description": " React Component to lazy load images using a HOC to track window scroll position. ",
55
"main": "build/index.js",
66
"peerDependencies": {
@@ -32,7 +32,7 @@
3232
},
3333
"repository": {
3434
"type": "git",
35-
"url": "git+https://github.com/Aljullu/react-lazy-load-image.git"
35+
"url": "git+https://github.com/Aljullu/react-lazy-load-image-component.git"
3636
},
3737
"keywords": [
3838
"react",
@@ -44,7 +44,7 @@
4444
},
4545
"license": "MIT",
4646
"bugs": {
47-
"url": "https://github.com/Aljullu/react-lazy-load-image/issues"
47+
"url": "https://github.com/Aljullu/react-lazy-load-image-component/issues"
4848
},
49-
"homepage": "https://github.com/Aljullu/react-lazy-load-image#readme"
49+
"homepage": "https://github.com/Aljullu/react-lazy-load-image-component#readme"
5050
}

0 commit comments

Comments
 (0)