1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-27 03:01:26 +00:00
seahub/frontend/src/components/system-user-notification.js
awu0403 8cc5815107
Send notification to cloud user (#6415)
* send subscription expire notification

* optimize code

---------

Co-authored-by: 孙永强 <11704063+s-yongqiang@user.noreply.gitee.com>
2025-04-21 13:30:35 +08:00

44 lines
981 B
JavaScript

import React from 'react';
import '../css/system-notification.css';
import SystemUserNotificationItem from './system-user-notification-item';
import { notificationAPI } from '../utils/notification-api';
class SystemUserNotification extends React.Component {
constructor(props) {
super(props);
this.state = {
userNoteMsgs: []
};
}
componentDidMount() {
notificationAPI.listSysUserUnseenNotifications().then((res) => {
this.setState({
userNoteMsgs: res.data.notifications
});
});
}
render() {
let { userNoteMsgs } = this.state;
if (!userNoteMsgs) {
return null;
}
const userNoteMsgItem = userNoteMsgs.map((item, index) => {
return (
<SystemUserNotificationItem
key={index}
notificationItem={item}
msg={item.msg_format}
notificationID={item.id}
/>
);
});
return userNoteMsgItem;
}
}
export default SystemUserNotification;