react-notification
Advanced tools
Comparing version 6.4.0 to 6.5.0
# Contributing | ||
[![Dependency Status](https://david-dm.org/pburtchaell/react-notification.svg)](https://david-dm.org/pburtchaell/react-notification) [![Build Status](https://travis-ci.org/pburtchaell/react-notification.svg)](https://travis-ci.org/pburtchaell/react-notification) | ||
**It is imperative that pull requests include tests and documentation and issues follow guidelines.** Please be familar with the [GitHub Community Guidelines](https://help.github.com/articles/github-community-guidelines/) before contributing to this project. If you are new to open source, check out this 38 minute course on [how to contribute to open source on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github). It's free! :smile: | ||
@@ -4,0 +6,0 @@ |
@@ -50,5 +50,8 @@ 'use strict'; | ||
if (this.props.dismissAfter === false) return; | ||
if (!nextProps.hasOwnProperty('isLast')) { | ||
// See http://eslint.org/docs/rules/no-prototype-builtins | ||
if (!{}.hasOwnProperty.call(nextProps, 'isLast')) { | ||
clearTimeout(this.dismissTimeout); | ||
} | ||
if (nextProps.onDismiss && nextProps.isActive && !this.props.isActive) { | ||
@@ -74,6 +77,6 @@ this.dismissTimeout = setTimeout(nextProps.onDismiss, nextProps.dismissAfter); | ||
var _props = this.props; | ||
var isActive = _props.isActive; | ||
var barStyle = _props.barStyle; | ||
var activeBarStyle = _props.activeBarStyle; | ||
var _props = this.props, | ||
isActive = _props.isActive, | ||
barStyle = _props.barStyle, | ||
activeBarStyle = _props.activeBarStyle; | ||
@@ -176,3 +179,2 @@ | ||
{ | ||
ref: 'title', | ||
className: 'notification-bar-title', | ||
@@ -185,6 +187,3 @@ style: this.getTitleStyle() | ||
'span', | ||
{ | ||
ref: 'message', | ||
className: 'notification-bar-message' | ||
}, | ||
{ className: 'notification-bar-message' }, | ||
this.props.message | ||
@@ -195,3 +194,2 @@ ), | ||
{ | ||
ref: 'action', | ||
className: 'notification-bar-action', | ||
@@ -198,0 +196,0 @@ onClick: this.handleClick, |
@@ -53,6 +53,8 @@ 'use strict'; | ||
/* eslint-disable react/no-unused-prop-types, react/forbid-prop-types */ | ||
NotificationStack.propTypes = { | ||
dismissInOrder: _react.PropTypes.bool, | ||
activeBarStyleFactory: _react.PropTypes.func, | ||
barStyleFactory: _react.PropTypes.func, | ||
dismissInOrder: _react.PropTypes.bool.isRequired, | ||
notifications: _react.PropTypes.array.isRequired, | ||
@@ -63,8 +65,10 @@ onDismiss: _react.PropTypes.func.isRequired | ||
NotificationStack.defaultProps = { | ||
activeBarStyleFactory: defaultStyleFactory, | ||
barStyleFactory: defaultStyleFactory, | ||
dismissInOrder: true, | ||
dismissAfter: 1000, | ||
activeBarStyleFactory: defaultStyleFactory, | ||
barStyleFactory: defaultStyleFactory | ||
dismissAfter: 1000 | ||
}; | ||
/* eslint-enable no-alert, no-console */ | ||
exports.default = NotificationStack; |
{ | ||
"name": "react-notification", | ||
"version": "6.4.0", | ||
"version": "6.5.0", | ||
"description": "Snackbar style notification component for React.", | ||
@@ -39,6 +39,9 @@ "main": "dist/index.js", | ||
"homepage": "https://github.com/pburtchaell/react-notification", | ||
"peerDependencies": { | ||
"react": "^0.14.0 || ^15.0.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.6.5", | ||
"babel-core": "^6.7.2", | ||
"babel-eslint": "^6.0.0", | ||
"babel-eslint": "^7.1.1", | ||
"babel-loader": "^6.2.4", | ||
@@ -50,7 +53,10 @@ "babel-plugin-transform-object-assign": "^6.8.0", | ||
"chai": "^3.5.0", | ||
"chai-enzyme": "^0.4.1", | ||
"chai-enzyme": "^0.6.0", | ||
"cheerio": "^0.22.0", | ||
"enzyme": "^2.1.0", | ||
"eslint": "^2.5.1", | ||
"eslint-config-airbnb": "^6.2.0", | ||
"eslint-plugin-react": "^4.2.3", | ||
"eslint": "^3.10.2", | ||
"eslint-config-airbnb": "^13.0.0", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-jsx-a11y": "^2.2.3", | ||
"eslint-plugin-react": "^6.7.1", | ||
"express": "^4.13.4", | ||
@@ -60,8 +66,8 @@ "express-urlrewrite": "^1.2.0", | ||
"immutable": "^3.8.1", | ||
"jsdom": "^8.5.0", | ||
"mocha": "^2.4.5", | ||
"jsdom": "^9.8.3", | ||
"mocha": "^3.1.2", | ||
"pre-commit": "^1.1.3", | ||
"react": "^0.14.7", | ||
"react-addons-test-utils": "^0.14.7", | ||
"react-dom": "^0.14.7", | ||
"react": "^15.0.0", | ||
"react-addons-test-utils": "^15.0.0", | ||
"react-dom": "^15.0.0", | ||
"sinon": "^1.17.3", | ||
@@ -68,0 +74,0 @@ "webpack": "^1.12.14", |
# react-notification | ||
[![npm version](https://badge.fury.io/js/react-notification.svg)](http://badge.fury.io/js/react-notification) [![Dependency Status](https://david-dm.org/pburtchaell/react-notification.svg)](https://david-dm.org/pburtchaell/react-notification) [![Build Status](https://travis-ci.org/pburtchaell/react-notification.svg)](https://travis-ci.org/pburtchaell/react-notification) [![npm downloads](https://img.shields.io/npm/dm/react-notification.svg?style=flat)](http://badge.fury.io/js/react-notification) | ||
[![npm version](https://badge.fury.io/js/react-notification.svg)](http://badge.fury.io/js/react-notification) [![Build Status](https://travis-ci.org/pburtchaell/react-notification.svg)](https://travis-ci.org/pburtchaell/react-notification) [![npm downloads](https://img.shields.io/npm/dm/react-notification.svg?style=flat)](http://badge.fury.io/js/react-notification) | ||
@@ -5,0 +5,0 @@ ## Overview |
@@ -7,5 +7,3 @@ export default { | ||
title: 'Title', | ||
onClick: function handleClick() { | ||
return; | ||
}, | ||
onClick: function handleClick() {}, | ||
barStyle: { | ||
@@ -12,0 +10,0 @@ background: 'rgb(2, 2, 2)' |
@@ -91,3 +91,3 @@ import React from 'react'; | ||
it('should render message element', () => { | ||
let element = (<div></div>); | ||
const element = (<div />); | ||
@@ -169,3 +169,3 @@ // eslint-disable-next-line | ||
it('onDismiss does not fire before `dismissAfter` value times out', done => { | ||
it('onDismiss does not fire before `dismissAfter` value times out', (done) => { | ||
const handleDismiss = spy(); | ||
@@ -194,3 +194,3 @@ | ||
it('onDismiss fires after `dismissAfter` value times out', done => { | ||
it('onDismiss fires after `dismissAfter` value times out', (done) => { | ||
const handleDismiss = spy(); | ||
@@ -218,3 +218,3 @@ | ||
it('onDismiss fires once when dismissAfter is passed', done => { | ||
it('onDismiss fires once when dismissAfter is passed', (done) => { | ||
const handleDismiss = spy(); | ||
@@ -221,0 +221,0 @@ |
@@ -20,3 +20,3 @@ import React from 'react'; | ||
mockNotification, | ||
{ onClick: (deactivate) => deactivate() } | ||
{ onClick: deactivate => deactivate() } | ||
); | ||
@@ -37,3 +37,3 @@ | ||
it('notifications dismissed independently if `dismissInOrder` set to false', done => { | ||
it('notifications dismissed independently if `dismissInOrder` set to false', (done) => { | ||
const handleDismiss = spy(); | ||
@@ -62,3 +62,3 @@ | ||
it('onDismiss fires after `dismissAfter` value + transition time', done => { | ||
it('onDismiss fires after `dismissAfter` value + transition time', (done) => { | ||
const handleDismiss = spy(); | ||
@@ -86,3 +86,3 @@ | ||
it('onDismiss fires on each Notification in the stack', done => { | ||
it('onDismiss fires on each Notification in the stack', (done) => { | ||
const handleDismiss = spy(); | ||
@@ -89,0 +89,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
373579
1
31
934