Skip to content

Instantly share code, notes, and snippets.

@hartmamt
Created March 24, 2015 10:37
Show Gist options
  • Save hartmamt/5dbab23b2bdeb7c6b91f to your computer and use it in GitHub Desktop.
Save hartmamt/5dbab23b2bdeb7c6b91f to your computer and use it in GitHub Desktop.
arus-notification-container.js
import React from 'react';
import PSConnector from 'arus-ps-connector';
import ArusNotification from 'arus-notifications';
import BlackLion from 'BlackLion';
import { NotificationStore, NotificationActions } from 'BlackLion';
//SET SIS CONNECTOR!!!!!!
BlackLion.SetSISConnector(PSConnector);
var ArusNotificationContainer = React.createClass({
getInitialState() {
return {
notifications: []
};
},
onStatusChange(status) {
this.setState({notifications: status});
},
componentDidMount(){
this.subscribe = NotificationStore.listen(this.onStatusChange);
NotificationActions.load();
},
componentWillUnmount() {
this.unsubscribe();
},
render() {
return (
<ArusNotification notifications={this.state.notifications} />
);
}
});
React.render(<ArusNotificationContainer/>, document.getElementById('arus'));
module.exports = Arus;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment