This repository has been archived by the owner on Dec 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from pburtchaell/v2
Version 2.0.0
- Loading branch information
Showing
23 changed files
with
545 additions
and
356 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 @@ | ||
{ | ||
"stage": 0, | ||
"loose": "all" | ||
} |
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,23 @@ | ||
{ | ||
"extends": "eslint-config-airbnb", | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"es6": true, | ||
"mocha": true | ||
}, | ||
"ecmaFeatures": { | ||
"jsx": true, | ||
"modules": true | ||
}, | ||
"rules": { | ||
"react/jsx-uses-react": 2, | ||
"react/jsx-uses-vars": 2, | ||
"react/react-in-jsx-scope": 2, | ||
"padded-blocks": 0, | ||
"block-scoped-var": 0 | ||
}, | ||
"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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules/ | ||
bin/tests/.tmp/ | ||
dist/ | ||
*.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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
bin/ | ||
example/ | ||
webpack.config.js | ||
src/ | ||
.eslintrc | ||
.babelrc | ||
Makefile | ||
webpack.local.config.js | ||
webpack.local.server.js |
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,24 @@ | ||
# Contributing | ||
|
||
**Please make sure your PR includes both tests and documentation.** | ||
|
||
## Getting started | ||
|
||
1. Clone the repository | ||
2. Install dependencies: `npm install` | ||
3. You can now add any changes needed. | ||
4. Run unit test and linter: `npm test` | ||
|
||
## File organization | ||
|
||
All code, including tests, is written in next-generation JavaScript and transpiled using Babel. Source files are located in `src` and transpiled to `dist`, which is gitignored. | ||
|
||
Tests should be placed in a `test` directory. Note that running tests uses JSDom, which requires io.js. | ||
|
||
## Documentation | ||
|
||
New features or API changes should be documented in the README. | ||
|
||
## Code style | ||
|
||
Code is linted using ESLint and babel-eslint. Rules are located in `.eslintrc`. Please do your best to maintain the existing code style. |
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 @@ | ||
bin = ./node_modules/.bin | ||
|
||
SRC_JS = $(shell find src -name "*.js") | ||
DIST_JS = $(patsubst src/%.js, dist/%.js, $(SRC_JS)) | ||
|
||
$(DIST_JS): dist/%.js: src/%.js | ||
mkdir -p $(dir $@) | ||
$(bin)/babel $< -o $@ | ||
|
||
# Task: js | ||
# Builds distribution JS files for publishing to npm. | ||
js: $(DIST_JS) | ||
|
||
# Task: test-all | ||
# Runs all unit tests | ||
test-all: | ||
NODE_ENV=test `npm bin`/mocha --compilers js:babel/register --recursive | ||
`npm bin`/eslint ./src/*.js | ||
`npm bin`/eslint ./test/*.js | ||
`npm bin`/eslint ./examples/es2015/*.js |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 1.0.0 to 2.0.0 | ||
|
||
The 2.0.0 release is a component with no local state and consequently, no methods to show and hide the component. Instead, you need to use the `isActive` prop to control the visibility of the component. | ||
|
||
Additionally, the functionality of the `dissmissAfter` prop is changed. Instead of the component dismissing the notification using local state, it will run a callback event `onDismiss` after the time specified in `dismissAfter`. | ||
|
||
For example, if you want your notification to dismiss after two seconds: | ||
|
||
```js | ||
var props = { | ||
isActive: this.state.isNotficationActive, | ||
message: 'This is a notification', | ||
action: 'Dismiss', | ||
dismissAfter: 2000, | ||
onDismiss: this.hideMyNotification, | ||
onClick: this.hideMyNotification | ||
} | ||
|
||
<Notfication {...props} /> | ||
``` | ||
|
||
If you have questions, please feel free to create an issue on GitHub or message me (@pburtchaell) on the [Reactiflux Slack community](http://www.reactiflux.com/). |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Examples | ||
|
||
- ES5 example using `React.createClass`. | ||
- ES 2015 example with multiple notifications. |
Oops, something went wrong.