Skip to content

Commit 15c1e15

Browse files
committed
React Simple Pull To Refresh
1 parent 4223792 commit 15c1e15

Some content is hidden

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

43 files changed

+19526
-1
lines changed

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# dependencies
2+
/node_modules
3+
4+
# production
5+
/build
6+
7+
# misc
8+
.DS_Store
9+
.ideas
10+
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
15+
#rollup
16+
/build
17+
.env

.prettierrc.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
printWidth: 110
2+
tabWidth: 2
3+
useTabs: false
4+
semi: true
5+
singleQuote: true
6+
quoteProps: 'consistent'
7+
jsxSingleQuote: false
8+
trailingComma: 'es5'
9+
bracketSpacing: true
10+
jsxBracketSameLine: false
11+
arrowParens: 'avoid'

.vscode/settings.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"workbench.colorCustomizations": {
3+
"titleBar.activeForeground": "#61dafb",
4+
"titleBar.inactiveForeground": "#53b7d3",
5+
"titleBar.activeBackground": "#20232a",
6+
"titleBar.inactiveBackground": "#0a0e16"
7+
},
8+
"editor.formatOnSave": true,
9+
"files.insertFinalNewline": true,
10+
"editor.tabSize": 2
11+
}

LICENCE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2019 GUIBERT THOMAS
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+50-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,50 @@
1-
# react-simple-pull-to-refresh
1+
# react-simple-pull-to-refresh
2+
3+
[![npm version](https://badge.fury.io/js/react-simple-pull-to-refresh.svg)](https://badge.fury.io/js/react-simple-pull-to-refresh)
4+
[![license](https://img.shields.io/github/license/thmsgbrt/react-simple-pull-to-refresh.svg)](https://github.com/thmsgbrt/react-simple-pull-to-refresh/blob/master/LICENSE)
5+
A Simple Pull To Refresh Component for React Application with 0 dependency.
6+
7+
## Demo
8+
9+
TBD
10+
11+
## installation
12+
13+
`npm install react-simple-pull-to-refresh`
14+
15+
## Usage
16+
17+
#### import PullToRefresh
18+
19+
```tsx
20+
import PullToRefresh from 'react-simple-pull-to-refresh';
21+
```
22+
23+
#### Sample
24+
25+
```tsx
26+
<PullToRefresh onRefresh={handleRefresh}>
27+
<ul>
28+
{list.map((item: string, index: number) => (
29+
<li key={index}>{item}</li>
30+
))}
31+
</ul>
32+
</PullToRefresh>
33+
```
34+
35+
## Props Matrix
36+
37+
| Name | Type | Required | Description |
38+
| :-----------------: | :-------------------: | :------: | ------------------------------------------------------------- |
39+
| refreshingContent | JSX.Element or string | false | Content displayed when refresh has been trigerred |
40+
| pullingContent | JSX.Element or string | false | Content displayed when pulling |
41+
| pullDownThreshold | number | false | Distance to pull in pixel in order to trigger a refresh event |
42+
| maxPullDownDistance | number | false | Maximum distance applied to Children when dragging |
43+
| onRefresh | Function | true | Function called when fefresh has been trigerred |
44+
| backgroundColor | string | false | Apply a backgroundColor |
45+
| isPullable | boolean | false | Enable or disable pulling behavior |
46+
| className | string | false | |
47+
48+
## Contributing
49+
50+
`npm run dev`

0 commit comments

Comments
 (0)