Created
March 24, 2015 10:37
-
-
Save hartmamt/5dbab23b2bdeb7c6b91f to your computer and use it in GitHub Desktop.
arus-notification-container.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
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