1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 07:01:12 +00:00

[user notifications] rewrote it with react (#4486)

* [user notifications] rewrote it with react

* rewrote 'user notifications' page with react
* cleaned up the related files & code
* fixed 'popup notices'

* [seafile-js] updated the version
This commit is contained in:
llj
2020-03-24 15:24:47 +08:00
committed by GitHub
parent ac9e9b9ea4
commit 24b3b516bd
14 changed files with 287 additions and 253 deletions

View File

@@ -19,7 +19,8 @@ class Notification extends React.Component {
});
}
onClick = () => {
onClick = (e) => {
e.preventDefault();
if (this.state.showNotice) {
seafileAPI.updateNotifications();
this.setState({
@@ -35,7 +36,7 @@ class Notification extends React.Component {
loadNotices = () => {
let page = 1;
let perPage = 5;
seafileAPI.listPopupNotices(page, perPage).then(res => {
seafileAPI.listNotifications(page, perPage).then(res => {
let noticeList = res.data.notification_list;
this.setState({noticeList: noticeList});
});
@@ -61,7 +62,7 @@ class Notification extends React.Component {
return (
<div id="notifications">
<a href="#" onClick={this.onClick} className="no-deco" id="notice-icon" title="Notifications" aria-label={gettext('Notifications')}>
<a href="#" onClick={this.onClick} className="no-deco" id="notice-icon" title={gettext('Notifications')} aria-label={gettext('Notifications')}>
<span className="sf2-icon-bell"></span>
<span className={`num ${this.state.unseenCount ? '' : 'hide'}`}>{this.state.unseenCount}</span>
</a>