Skip to content

Commit a2cad56

Browse files
committed
Initial Commit
0 parents  commit a2cad56

20 files changed

+21092
-0
lines changed

.babelrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"presets": [
3+
["env", {
4+
"modules": false
5+
}],
6+
"stage-0",
7+
"react"
8+
]
9+
}

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintrc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": [
4+
"standard",
5+
"standard-react"
6+
],
7+
"env": {
8+
"es6": true
9+
},
10+
"plugins": [
11+
"react"
12+
],
13+
"parserOptions": {
14+
"sourceType": "module"
15+
},
16+
"rules": {
17+
// don't force es6 functions to include space before paren
18+
"space-before-function-paren": 0,
19+
20+
// allow specifying true explicitly for boolean props
21+
"react/jsx-boolean-value": 0
22+
}
23+
}

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
# See https://help.github.com/ignore-files/ for more about ignoring files.
3+
4+
node_modules
5+
/.idea
6+
7+
# builds
8+
build
9+
dist
10+
.rpt2_cache
11+
12+
# misc
13+
.DS_Store
14+
.env
15+
.env.local
16+
.env.development.local
17+
.env.test.local
18+
.env.production.local
19+
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# react-top-loading-bar
2+
3+
>
4+
5+
[![NPM](https://img.shields.io/npm/v/react-top-loading-bar.svg)](https://www.npmjs.com/package/react-top-loading-bar) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
6+
7+
## Install
8+
9+
```bash
10+
npm install --save react-top-loading-bar
11+
```
12+
13+
## Usage
14+
15+
```jsx
16+
import React, { Component } from 'react'
17+
18+
import LoadingBar from 'react-top-loading-bar'
19+
20+
export default class App extends Component {
21+
state = {
22+
loadingBarProgress: 0
23+
}
24+
25+
add = value => {
26+
this.setState({loadingBarProgress: this.state.loadingBarProgress + value})
27+
}
28+
29+
complete = () => {
30+
this.setState({loadingBarProgress: 100})
31+
}
32+
33+
onLoaderFinished = () => {
34+
this.setState({loadingBarProgress: 0})
35+
}
36+
37+
render () {
38+
return (
39+
<div>
40+
<LoadingBar
41+
progress={this.state.loadingBarProgress}
42+
height={3}
43+
color='red'
44+
onLoaderFinished={() => this.onLoaderFinished}
45+
/>
46+
<button onClick={() => this.add(10)}>Add 10</button>
47+
<button onClick={() => this.add(30)}>Add 30</button>
48+
<button onClick={() => this.complete()}>Complete</button>
49+
</div>
50+
)
51+
}
52+
}
53+
54+
```
55+
56+
## License
57+
58+
MIT © [klendi](https://github.com/klendi)

0 commit comments

Comments
 (0)