From b5a52668e94adc3dca5ba5eb7b858ea53c67d44c Mon Sep 17 00:00:00 2001 From: Michael An <2331806369@qq.com> Date: Mon, 2 Dec 2024 13:35:49 +0800 Subject: [PATCH] change notification dialog style --- frontend/src/components/common/notice-item.js | 6 +- .../common/notification-popover/index.css | 7 ++ frontend/src/css/user-notifications.css | 86 ++++++++++++++++++- frontend/src/user-notifications.js | 23 ++--- 4 files changed, 109 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/common/notice-item.js b/frontend/src/components/common/notice-item.js index 33dbc50d95..ff243d8b8c 100644 --- a/frontend/src/components/common/notice-item.js +++ b/frontend/src/components/common/notice-item.js @@ -403,9 +403,13 @@ class NoticeItem extends React.Component { } return this.props.tr ? ( - + + {!noticeItem.seen && } + + + {username || gettext('System')}

diff --git a/frontend/src/components/common/notification-popover/index.css b/frontend/src/components/common/notification-popover/index.css index f41e431809..405bc41abd 100644 --- a/frontend/src/components/common/notification-popover/index.css +++ b/frontend/src/components/common/notification-popover/index.css @@ -207,3 +207,10 @@ .notification-container .notification-body .nav .nav-item .nav-link.active { color: #ED7109; } + +@media (max-width: 768px) { + .notification-container { + right: -60px; + width: 360px; + } +} diff --git a/frontend/src/css/user-notifications.css b/frontend/src/css/user-notifications.css index 724b5ceed7..3fc84b8090 100644 --- a/frontend/src/css/user-notifications.css +++ b/frontend/src/css/user-notifications.css @@ -49,6 +49,32 @@ padding: 12px 8px; } +.notification-list-content .notification-modal-body .notice-dialog-side .nav-item { + position: relative; +} + +.notification-list-content .notification-modal-body .notice-dialog-side .nav-item .nav-link { + border: none; +} + +.notification-list-content .notification-modal-body .notice-dialog-side .nav-item .nav-link.active { + background-color: #F5F5F5; + color: #212529; +} + +.notification-list-content .notification-modal-body .notice-dialog-side .nav-item .nav-link.active::before { + content: ''; + position: absolute; + display: block; + width: 3px; + height: 26px; + left: -5px; + top: 2px; + background-color: #ff9800; + border-radius: 2px; + z-index: 2; +} + .notification-list-content .notification-modal-body .notice-dialog-main { display: flex; flex: 0 0 80%; @@ -57,7 +83,7 @@ .notification-modal-body .notification-dialog-body { overflow: auto; - padding: 2rem 1rem; + padding: 1rem; height: 100%; } @@ -91,8 +117,64 @@ .notification-dialog-body table td { padding: 0.5rem 0.1875rem; - border-bottom: 1px solid #eee; + border-bottom: none; color: #212529; font-size: 14px; word-break: break-all; } + +.notification-dialog-body table td ul { + list-style: none; +} + +.notification-dialog-body .notification-user-name { + font-weight: normal; +} + +.notification-dialog-body .notification-item .avatar { + width: 24px; + height: 24px; +} + +.notification-dialog-body .notification-item .notification-point { + top: calc(50% - 4px); +} + +@media (max-width: 768px) { + + .notification-list-dialog { + width: 100%; + max-width: 100%; + height: 100%; + margin: 0; + } + + .notification-list-content .notification-modal-body { + display: block; + } + + .notification-list-content .notification-modal-body .notice-dialog-side { + display: block; + padding: 0; + } + + .notification-list-content .notification-item .notification-user-name { + display: none; + } + + .notification-list-content .notice-dialog-main { + height: 100%; + } + + .notification-list-content .notice-dialog-side>ul { + flex-direction: row !important; + } + + .notification-list-content .notice-dialog-side>ul>li { + width: 50% !important; + } + + .notification-list-content .notice-dialog-side>ul>li .nav-link:before { + display: none; + } +} diff --git a/frontend/src/user-notifications.js b/frontend/src/user-notifications.js index 07da49f047..90279dc97e 100644 --- a/frontend/src/user-notifications.js +++ b/frontend/src/user-notifications.js @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; +import classname from 'classnames'; import { Modal, ModalHeader, ModalBody, Dropdown, DropdownToggle, DropdownMenu, DropdownItem, TabPane, Nav, NavItem, NavLink, TabContent } from 'reactstrap'; import { Utils } from './utils/utils'; import { gettext } from './utils/constants'; @@ -214,15 +215,15 @@ class UserNotificationsDialog extends React.Component { return ( <>
-