Socket
Socket
Sign inDemoInstall

react-notification-center

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-notification-center - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

3

package.json
{
"name": "react-notification-center",
"version": "1.1.0",
"version": "1.2.0",
"description": "react-notification-center keep all your notification in a single place",

@@ -123,4 +123,5 @@ "main": "lib/index.js",

"classnames": "^2.2.3",
"element-class": "^0.2.2",
"eventemitter3": "^1.1.1"
}
}
import React, {Component, PropTypes} from 'react';
import cn from 'classnames';
import elementClass from 'element-class';
import NotificationItem from './Item';

@@ -47,2 +48,3 @@ import Header from './header';

this.toggleNotification = this.toggleNotification.bind(this);
this.timeout = null;
}

@@ -56,10 +58,10 @@

componentDidUpdate() {
}
componentWillReceiveProps(nextProps) {
if (nextProps.notifications.length !== this.state.notifications.length) {
this.setState({
notifications: nextProps.notifications
});
elementClass(this.refs.notificationIcon).add('pulse');
this.timeout = setTimeout(() => {
elementClass(this.refs.notificationIcon).remove('pulse');
}, 1200);
this.setState({notifications: nextProps.notifications});
}

@@ -69,2 +71,5 @@ }

componentWillUnmount() {
if (this.timeout) {
clearTimeout(this.timeout);
}
if (document) {

@@ -161,14 +166,12 @@ document.removeEventListener('click', this.toggleNotification);

}
{this.state.notifications &&
<ul className="rn-ul">
{this.state.notifications.map((item, i) => {
return (
<NotificationItem
key={i} onClick={this.onItemClick.bind(this, item)}
options={this.mapOptions()}
{...item}/>
);
})}
</ul>
}
<ul className="rn-ul">
{this.state.notifications.map((item, i) => {
return (
<NotificationItem
key={i} onClick={this.onItemClick.bind(this, item)}
options={this.mapOptions()}
{...item}/>
);
})}
</ul>
</Content>

@@ -175,0 +178,0 @@ <Footer></Footer>

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc