| import React from 'react';
|
| import { useNavigate,useLocation } from 'react-router-dom';
|
| import './personalSubpage.css';
|
| const Notice = ({ onLogout }) => {
|
| const navigate = useNavigate();
|
| const location = useLocation();
|
| const [notices] = React.useState([
|
| content: '您上传的资源《盗梦空间》获得100积分奖励',
|
| content: '服务器将于今晚2:00-4:00进行维护',
|
| const handleBack = () => {
|
| fromSubpage: true, // 标记来自子页面
|
| dashboardTab: location.state?.dashboardTab // 保留Dashboard的标签页状态
|
| replace: true // 替换当前历史记录
|
| <div className="subpage-container">
|
| <button className="back-button" onClick={(handleBack)}>
|
| <h2 className="page-title">消息通知</h2>
|
| <div className="notice-list">
|
| <div key={notice.id} className={`list-item ${!notice.read ? 'unread' : ''}`}>
|
| <div className="notice-header">
|
| <span className="notice-date">{notice.date}</span>
|
| <p className="notice-content">{notice.content}</p>
|