1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 16:10:26 +00:00

Repair eslint wraning (#2453)

This commit is contained in:
山水人家
2018-10-16 18:19:51 +08:00
committed by Daniel Pan
parent 80b7e562a0
commit fdbb39a6d3
43 changed files with 498 additions and 264 deletions

View File

@@ -95,11 +95,11 @@ class Account extends Component {
renderAvatar = () => {
if (this.state.avatarURL) {
return (
<img src={this.state.avatarURL} width="36" height="36" className="avatar" />
<img src={this.state.avatarURL} width="36" height="36" className="avatar" alt={gettext('avatar')} />
);
}
return (
<img src="" width="36" height="36" className="avatar" />
<img src="" width="36" height="36" className="avatar" alt={gettext('avatar')} />
);
}
@@ -107,7 +107,7 @@ class Account extends Component {
return (
<div id="account">
<a id="my-info" onClick={this.onClickAccount} className="account-toggle no-deco d-none d-md-block" aria-label="View profile and more">
<span><img src={this.state.avatarURL} width="36" height="36" className="avatar" /></span>
<span><img src={this.state.avatarURL} width="36" height="36" className="avatar" alt={gettext('avatar')} /></span>
<span className="fas fa-caret-down vam"></span>
</a>
<span className="account-toggle sf2-icon-more mobile-icon d-md-none" aria-label="View profile and more" onClick={this.onClickAccount}></span>

View File

@@ -8,20 +8,20 @@ class Notification extends React.Component {
this.state = {
showNotice: false,
notice_html: ''
}
};
}
onClick = () => {
this.setState({
showNotice: !this.state.showNotice
})
});
if (!this.state.showNotice) {
this.loadNotices()
this.loadNotices();
}
if (this.state.showNotice) {
seafileAPI.updateNotifications()
seafileAPI.updateNotifications();
}
}
@@ -29,8 +29,8 @@ class Notification extends React.Component {
seafileAPI.listPopupNotices().then(res => {
this.setState({
notice_html: res.data.notice_html
})
})
});
});
}
render() {
@@ -49,13 +49,12 @@ class Notification extends React.Component {
<a href="#" onClick={this.onClick} title={gettext('Close')} aria-label={gettext('Close')} className="sf-popover-close js-close sf2-icon-x1 op-icon float-right"></a>
</div>
<div className="sf-popover-con">
<ul className="notice-list" dangerouslySetInnerHTML={{__html: notice_html}}>
</ul>
<ul className="notice-list" dangerouslySetInnerHTML={{__html: notice_html}}></ul>
<a href="/notification/list/" className="view-all">{gettext('See All Notifications')}</a>
</div>
</div>
</div>
)
);
}
}