-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ac9618f
Showing
22 changed files
with
506 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
exclude_paths: | ||
- "examples/*" | ||
- "lib/*" | ||
- "test/*" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
examples | ||
lib | ||
node_modules | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"mocha": true, | ||
"node": true, | ||
"es6": true | ||
}, | ||
"ecmaFeatures": { | ||
"modules": true, | ||
"jsx": true | ||
}, | ||
"rules": { | ||
"array-bracket-spacing": [2, "never"], | ||
"brace-style": [2, "1tbs"], | ||
"comma-dangle": [2, "never"], | ||
"comma-spacing": [2, { | ||
"before": false, | ||
"after": true | ||
}], | ||
"comma-style": [2, "last"], | ||
"eol-last": 2, | ||
"func-names": 2, | ||
"func-style": [2, "expression"], | ||
"indent": [2, 2], | ||
"key-spacing": [2, { | ||
"beforeColon": false, | ||
"afterColon": true | ||
}], | ||
"linebreak-style": [2, "unix"], | ||
"max-nested-callbacks": [2, 2], | ||
"new-parens": 2, | ||
"no-nested-ternary": 2, | ||
"no-new-object": 2, | ||
"no-spaced-func": 2, | ||
"no-trailing-spaces": 2, | ||
"no-unneeded-ternary": 2, | ||
"object-curly-spacing": [2, "always"], | ||
"padded-blocks": [2, "never"], | ||
"quote-props": [2, "as-needed"], | ||
"quotes": [2, "double"], | ||
"semi": [2, "always"], | ||
"semi-spacing": [2, { | ||
"before": false, | ||
"after": true | ||
}], | ||
"space-after-keywords": [2, "always"], | ||
"space-before-blocks": [2, "always"], | ||
"space-before-function-paren": [2, "never"], | ||
"space-in-parens": [2, "never"], | ||
"space-infix-ops": 2, | ||
"space-return-throw-case": 2, | ||
"space-unary-ops": [2, { | ||
"words": true, | ||
"nonwords": false | ||
}], | ||
"spaced-comment": [2, "always"], | ||
"wrap-regex": 2 | ||
}, | ||
"plugins": [ | ||
"react" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.log | ||
.DS_Store | ||
lib | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"esnext": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.log | ||
.DS_Store | ||
examples | ||
src | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- "iojs" | ||
script: | ||
- npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# React Progress HUD | ||
[](https://www.npmjs.com/package/react-progress-hud) | ||
[](https://www.npmjs.com/package/react-progress-hud) | ||
[](https://travis-ci.org/naoufal/react-native-progress-hu://travis-ci.org/naoufal/react-progress-hud) | ||
[](https://codeclimate.com/github/naoufal/react-progress-hud) | ||
|
||
React Progress HUD is a [React](https://facebook.github.io/react) port of the popular [`SVProgressHUD`](https://github.com/TransitApp/SVProgressHUD). It is a clean and easy-to-use HUD meant to display the progress of an ongoing task. | ||
|
||
## Install | ||
```shell | ||
npm i --save react-progress-hud | ||
``` | ||
|
||
## Usage | ||
Using the HUD in your app will usually look like this: | ||
```js | ||
import React, { Component } from "react"; | ||
import { ProgressHUD, Wrapper } from "react-progress-hud"; | ||
|
||
class YourComponent extends Component { | ||
render() { | ||
return ( | ||
<div> | ||
<button onClick={this.props.showProgressHUD>Show Progress HUD</button> | ||
<ProgressHUD | ||
isVisible={this.props.isVisible} | ||
clickHandler={this.props.dismissProgressHUD} | ||
overlayColor="rgba(0, 0, 0, 0.11)" | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Wrapper(App); | ||
``` | ||
### Showing the HUD | ||
You can display the HUD by calling: | ||
```js | ||
this.props.showProgressHUD(); | ||
``` | ||
### Dismissing the HUD | ||
It can be dismissed by calling: | ||
```js | ||
this.props.dismissProgressHUD(); | ||
``` | ||
## Props | ||
The following props can be used to modify the HUD's style and/or behaviour: | ||
| Prop | Type | Opt/Required | Default | Note | | ||
|---|---|---|---|---| | ||
|__`isVisible`__|_Boolean_|Required|`N/A`|Displays the HUD when set to true. | ||
|__`clickHandler`__|_Function_|Optional|`() => {}`|Sets a clickHandler on the `ProgressHUD`. | ||
|__`overlayColor`__|_String_|Optional|`rgba(0, 0, 0, 0)`|Sets the color of the overlay. | ||
|__`color`__|_String_|Optional|`#000`|Sets the color of the spinner. | ||
## License | ||
Copyright (c) 2015, [Naoufal Kadhom](http://naoufal.com) | ||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React, { Component } from "react"; | ||
import { ProgressHUD, Wrapper } from "../../../lib/index"; | ||
|
||
let App = React.createClass({ | ||
_renderButton() { | ||
return ( | ||
<button onClick={this._clickHandler}>Show Progress HUD</button> | ||
); | ||
}, | ||
|
||
_clickHandler() { | ||
this.props.showProgressHUD(); | ||
}, | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<h1>Progress HUD</h1> | ||
{this._renderButton()} | ||
<ProgressHUD | ||
isVisible={this.props.isVisible} | ||
overlayColor="rgba(0, 0, 0, 0.11)" | ||
clickHandler={this.props.dismissProgressHUD} | ||
/> | ||
</div> | ||
); | ||
} | ||
}); | ||
|
||
export default Wrapper(App); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<html> | ||
<head> | ||
<title>react-progress-hud-demo</title> | ||
</head> | ||
<body> | ||
<div id="root"> | ||
</div> | ||
<script src="/static/bundle.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
import App from './components/App'; | ||
|
||
React.render( | ||
<App />, | ||
document.getElementById('root') | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "react-progress-hud-example", | ||
"version": "1.0.0", | ||
"description": "react-progress-hud-example demo", | ||
"main": "server.js", | ||
"scripts": { | ||
"start": "node server.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/naoufal/react-progress-hud.git" | ||
}, | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/naoufal/react-progress-hud/issues" | ||
}, | ||
"homepage": "https://github.com/naoufal/react-progress-hud", | ||
"devDependencies": { | ||
"babel-core": "5.8.23", | ||
"babel-loader": "5.1.4", | ||
"node-libs-browser": "0.5.2", | ||
"react": "0.13.3", | ||
"react-hot-loader": "1.2.7", | ||
"webpack": "1.9.11", | ||
"webpack-dev-server": "1.9.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var webpack = require('webpack'); | ||
var WebpackDevServer = require('webpack-dev-server'); | ||
var config = require('./webpack.config'); | ||
|
||
new WebpackDevServer(webpack(config), { | ||
publicPath: config.output.publicPath, | ||
hot: true, | ||
historyApiFallback: true, | ||
stats: { | ||
colors: true | ||
} | ||
}).listen(3000, 'localhost', function (err) { | ||
if (err) { | ||
console.log(err); | ||
} | ||
|
||
console.log('Listening at localhost:3000'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
var path = require('path'); | ||
var webpack = require('webpack'); | ||
|
||
module.exports = { | ||
devtool: 'eval', | ||
entry: [ | ||
'webpack-dev-server/client?http://localhost:3000', | ||
'webpack/hot/only-dev-server', | ||
'./index' | ||
], | ||
|
||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: 'bundle.js', | ||
publicPath: '/static/' | ||
}, | ||
|
||
plugins: [ | ||
new webpack.HotModuleReplacementPlugin(), | ||
new webpack.NoErrorsPlugin(), | ||
], | ||
|
||
resolve: { | ||
alias: { | ||
'react-progress-hud': path.join(__dirname, '..', '..', 'src') | ||
}, | ||
extensions: ['', '.js'] | ||
}, | ||
|
||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.(js|jsx)$/, | ||
loaders: ['react-hot', 'babel'], | ||
exclude: /node_modules/, | ||
include: __dirname | ||
}, | ||
{ | ||
test: /\.(js|jsx)$/, | ||
loaders: ['babel'], | ||
include: path.join(__dirname, '..', '..', 'src') | ||
} | ||
] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "react-progress-hud", | ||
"version": "0.1.0", | ||
"description": "A clean and lightweight progress HUD for your React app", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"build": "./node_modules/.bin/babel --optional runtime src --out-dir lib", | ||
"build:watch": "./node_modules/.bin/babel --optional runtime src --watch --out-dir lib", | ||
"lint": "./node_modules/.bin/eslint .", | ||
"test": "npm run lint" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/naoufal/react-progress-hud" | ||
}, | ||
"keywords": [ | ||
"react", | ||
"progress", | ||
"hud", | ||
"popup", | ||
"loader", | ||
"loading", | ||
"react-component" | ||
], | ||
"author": "Naoufal Kadhom", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/naoufal/react-progress-hud/issues" | ||
}, | ||
"homepage": "https://github.com/naoufal/react-progress-hud", | ||
"devDependencies": { | ||
"babel": "5.8.23", | ||
"babel-eslint": "4.1.1", | ||
"babel-runtime": "5.8.20", | ||
"eslint": "1.3.1", | ||
"eslint-plugin-react": "3.3.1", | ||
"react": "0.13.3", | ||
"react-motion": "0.2.7" | ||
} | ||
} |
Oops, something went wrong.