lint jsx files

This commit is contained in:
Lachlan Kermode
2019-01-23 11:35:34 +00:00
parent 939a4833b8
commit fb4d0c2d86
28 changed files with 572 additions and 627 deletions

View File

@@ -1,34 +1,33 @@
import React from 'react';
import React from 'react'
export default class Notification extends React.Component{
constructor(props) {
super();
export default class Notification extends React.Component {
constructor (props) {
super()
this.state = {
isExtended: false
}
}
toggleDetails() {
this.setState({ isExtended: !this.state.isExtended });
toggleDetails () {
this.setState({ isExtended: !this.state.isExtended })
}
renderItems(items) {
if (!items) return '';
renderItems (items) {
if (!items) return ''
return (
<div>
{items.map((item) => {
if (item.error) {
return (<p>{item.error.message}</p>);
return (<p>{item.error.message}</p>)
}
return '';
return ''
})}
</div>
)
}
renderNotificationContent(notification) {
let { type, message, items } = notification;
renderNotificationContent (notification) {
let { type, message, items } = notification
return (
<div>
@@ -42,28 +41,28 @@ export default class Notification extends React.Component{
)
}
render() {
render () {
const notificationsToRender = this.props.notifications.filter(n => !('isRead' in n && n.isRead))
if (notificationsToRender.length > 0) {
return (
<div className={`notification-wrapper`}>
{this.props.notifications.map((notification) => {
return (
<div className='notification' onClick={() => this.toggleDetails() }>
<div className='notification' onClick={() => this.toggleDetails()}>
<button
onClick={this.props.onToggle}
className="side-menu-burg over-white is-active"
className='side-menu-burg over-white is-active'
>
<span />
</button>
{this.renderNotificationContent(notification)}
</div>
);
)
})
}
}
</div>
)
}
return (<div/>);
return (<div />)
}
}