-
Notifications
You must be signed in to change notification settings - Fork 249
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
Showing
12 changed files
with
488 additions
and
397 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,20 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
|
||
# Change these settings to your own preference | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# We recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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 @@ | ||
node_modeules/ | ||
dist/ | ||
example/ |
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 @@ | ||
{ | ||
"extends": "airbnb/legacy", | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
}, | ||
"plugins": [ | ||
"react" | ||
], | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"rules": { | ||
"react/display-name": [2, { "acceptTranspilerName": true }], | ||
"react/jsx-curly-spacing": [2, "always"], | ||
"react/jsx-no-duplicate-props": 2, | ||
"react/jsx-no-undef": 2, | ||
"react/jsx-quotes": 0, | ||
"react/jsx-uses-react": 2, | ||
"react/jsx-uses-vars": 2, | ||
"react/no-did-mount-set-state": 2, | ||
"react/no-did-update-set-state": 2, | ||
"react/no-multi-comp": 2, | ||
"react/no-unknown-property": 2, | ||
"react/prop-types": 2, | ||
"react/react-in-jsx-scope": 2, | ||
"react/require-extension": 2, | ||
"react/self-closing-comp": 2, | ||
"react/wrap-multilines": 2, | ||
"react/sort-comp": 0, | ||
|
||
"quotes": [2, "single", "avoid-escape"], | ||
"jsx-quotes": [2, "prefer-single"], | ||
"comma-dangle": [2, "never"], | ||
"indent": [2, 2], | ||
"object-curly-spacing": [2, "always"], | ||
"no-undef": 2, | ||
"no-underscore-dangle": 0, | ||
"func-names": 0, | ||
"no-else-return": 0, | ||
"no-console": 0, | ||
"no-throw-literal": 0, | ||
"id-length": 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 |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
|
||
A complete and totally customizable notification system for React applications. | ||
|
||
Initially built for [Eterpret](http://dev.eterpret.com) @ [Scalable Path](http://www.scalablepath.com). | ||
|
||
![Example gif](example/example.gif "Example gif") | ||
|
||
## Demo | ||
|
@@ -18,6 +20,22 @@ For now this component is only available as CommonJS module. Install via NPM run | |
npm install react-notification-system | ||
``` | ||
|
||
### Important | ||
|
||
For **React 0.14.x**, use version 0.2.x: | ||
|
||
``` | ||
npm install [email protected] | ||
``` | ||
|
||
For **React 0.13.x**, use version 0.1.x: | ||
|
||
``` | ||
npm install [email protected] | ||
``` | ||
|
||
|
||
|
||
## Using | ||
|
||
For optimal appearance, this component **must be rendered on a top level HTML element** in your application to avoid position conflicts. | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,24 +1,26 @@ | ||
var Helpers = { | ||
timer: function(callback, delay) { | ||
var timerId, start, remaining = delay; | ||
Timer: function(callback, delay) { | ||
var timerId; | ||
var start; | ||
var remaining = delay; | ||
|
||
this.pause = function() { | ||
clearTimeout(timerId); | ||
remaining -= new Date() - start; | ||
clearTimeout(timerId); | ||
remaining -= new Date() - start; | ||
}; | ||
|
||
this.resume = function() { | ||
start = new Date(); | ||
clearTimeout(timerId); | ||
timerId = setTimeout(callback, remaining); | ||
start = new Date(); | ||
clearTimeout(timerId); | ||
timerId = setTimeout(callback, remaining); | ||
}; | ||
|
||
this.clear = function() { | ||
clearTimeout(timerId); | ||
} | ||
}; | ||
|
||
this.resume(); | ||
} | ||
} | ||
}; | ||
|
||
module.exports = Helpers; |
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
Oops, something went wrong.