@symbolic/react-app
Advanced tools
Comparing version 1.3.31 to 1.3.32
{ | ||
"name": "@symbolic/react-app", | ||
"version": "1.3.31", | ||
"version": "1.3.32", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -1,33 +0,33 @@ | ||
import {_, className, Component, React} from 'components'; //eslint-disable-line | ||
import {connect} from '@symbolic/redux'; | ||
import {NotificationComponent} from 'resources'; | ||
import {Link} from 'react-router-dom'; | ||
import './notification.scss'; | ||
import Icon from 'components/icon/icon'; | ||
// import {_, className, Component, React} from 'components'; //eslint-disable-line | ||
// import {connect} from '@symbolic/redux'; | ||
// import {NotificationComponent} from 'resources'; | ||
// import {Link} from 'react-router-dom'; | ||
// import './notification.scss'; | ||
// import Icon from 'components/icon/icon'; | ||
const moment = require('moment-business-days'); | ||
// const moment = require('moment-business-days'); | ||
class Notification extends NotificationComponent { | ||
render() { | ||
var {id, resourceId, body, status, created} = this.props.notification; | ||
var domain = ''; | ||
var link = `${domain}/explorer/${resourceId}`; | ||
// class Notification extends NotificationComponent { | ||
// render() { | ||
// var {id, resourceId, body, status, created} = this.props.notification; | ||
// var domain = ''; | ||
// var link = `${domain}/explorer/${resourceId}`; | ||
var story = {id: 1, status: 'ready'}; | ||
// var story = {id: 1, status: 'ready'}; | ||
return !body ? null : ( | ||
<Link to={link} {...className([`notification`, `status-${status}`])}> | ||
<div className='n-label'> | ||
<div className='n-delete-button' onClick={() => this.destroyNotification(id)}>X</div> | ||
<div className='n-created-date'>{_.labelForMoment(moment(created))}</div> | ||
</div> | ||
<div className='n-body'>{body}</div> | ||
{resourceId && <Icon {...{story}}/>} | ||
</Link> | ||
); | ||
} | ||
} | ||
// return !body ? null : ( | ||
// <Link to={link} {...className([`notification`, `status-${status}`])}> | ||
// <div className='n-label'> | ||
// <div className='n-delete-button' onClick={() => this.destroyNotification(id)}>X</div> | ||
// <div className='n-created-date'>{_.labelForMoment(moment(created))}</div> | ||
// </div> | ||
// <div className='n-body'>{body}</div> | ||
// {resourceId && <Icon {...{story}}/>} | ||
// </Link> | ||
// ); | ||
// } | ||
// } | ||
// export default NotificationComponent.connect(Notification, {mapState: props => ({notifications: props.notifications})}); | ||
// // export default NotificationComponent.connect(Notification, {mapState: props => ({notifications: props.notifications})}); | ||
export default connect({mapState: state => ({notifications: state.notification}), mapDispatch: {}})(Notification); | ||
// export default connect({mapState: state => ({notifications: state.notification}), mapDispatch: {}})(Notification); |
@@ -1,27 +0,27 @@ | ||
import {_, className, Component, React, resourceActions} from 'components'; //eslint-disable-line | ||
import {connect} from '@symbolic/redux'; | ||
import {NotificationsComponent} from 'resources'; | ||
import Notification from './notification/notification'; | ||
import './notifications.scss'; | ||
// import {_, className, Component, React, resourceActions} from 'components'; //eslint-disable-line | ||
// import {connect} from '@symbolic/redux'; | ||
// import {NotificationsComponent} from 'resources'; | ||
// import Notification from './notification/notification'; | ||
// import './notifications.scss'; | ||
class Notifications extends NotificationsComponent { | ||
render() { | ||
return ( | ||
<div className='notifications'> | ||
{_.map(this.props.notifications, notification => ( | ||
<Notification key={notification.id} notification={notification}/> | ||
))} | ||
</div> | ||
); | ||
} | ||
} | ||
// class Notifications extends NotificationsComponent { | ||
// render() { | ||
// return ( | ||
// <div className='notifications'> | ||
// {_.map(this.props.notifications, notification => ( | ||
// <Notification key={notification.id} notification={notification}/> | ||
// ))} | ||
// </div> | ||
// ); | ||
// } | ||
// } | ||
export default connect({ | ||
mapState: state => ({ | ||
session: state.session, | ||
notifications: state.resources.notifications.byId | ||
}), | ||
mapDispatch: { | ||
..._.pick(resourceActions.notifications, ['trackNotifications']), | ||
} | ||
})(Notifications); | ||
// export default connect({ | ||
// mapState: state => ({ | ||
// session: state.session, | ||
// notifications: state.resources.notifications.byId | ||
// }), | ||
// mapDispatch: { | ||
// ..._.pick(resourceActions.notifications, ['trackNotifications']), | ||
// } | ||
// })(Notifications); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
21688