mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-11 21:08:36 +03:00
lint jsx files
This commit is contained in:
@@ -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 />)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user