Notification-popup patch

- Rename components per filename changes.
- Fix missing React key.
- Add new strings.
This commit is contained in:
infinite-persistence 2022-06-10 12:48:28 +08:00
parent c38e37cd38
commit b12fe2192b
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
4 changed files with 26 additions and 29 deletions

View file

@ -1289,6 +1289,7 @@
"No notifications": "No notifications", "No notifications": "No notifications",
"Try selecting another filter.": "Try selecting another filter.", "Try selecting another filter.": "Try selecting another filter.",
"You don't have any notifications yet, but they will be here when you do!": "You don't have any notifications yet, but they will be here when you do!", "You don't have any notifications yet, but they will be here when you do!": "You don't have any notifications yet, but they will be here when you do!",
"View all": "View all",
"I like this": "I like this", "I like this": "I like this",
"I dislike this": "I dislike this", "I dislike this": "I dislike this",
"Not interested": "Not interested", "Not interested": "Not interested",

View file

@ -163,12 +163,9 @@ export default function NotificationHeaderButton(props: Props) {
} }
return ( return (
<> <a onClick={() => handleNotificationClick(notification)} key={id}>
<a onClick={() => handleNotificationClick(notification)}>
<div <div
className={ className={is_read ? 'menu__list--notification' : 'menu__list--notification menu__list--notification-unread'}
is_read ? 'menu__list--notification' : 'menu__list--notification menu__list--notification-unread'
}
key={id} key={id}
> >
<div className="notification__icon">{icon}</div> <div className="notification__icon">{icon}</div>
@ -191,7 +188,6 @@ export default function NotificationHeaderButton(props: Props) {
</div> </div>
</div> </div>
</a> </a>
</>
); );
} }

View file

@ -1,11 +1,11 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { selectUnseenNotificationCount } from 'redux/selectors/notifications'; import { selectUnseenNotificationCount } from 'redux/selectors/notifications';
import { selectUser } from 'redux/selectors/user'; import { selectUser } from 'redux/selectors/user';
import NotificationHeaderButton from './view'; import NotificationButton from './view';
const select = (state) => ({ const select = (state) => ({
unseenCount: selectUnseenNotificationCount(state), unseenCount: selectUnseenNotificationCount(state),
user: selectUser(state), user: selectUser(state),
}); });
export default connect(select)(NotificationHeaderButton); export default connect(select)(NotificationButton);

View file

@ -10,7 +10,7 @@ type Props = {
user: ?User, user: ?User,
}; };
export default function NotificationHeaderButton(props: Props) { export default function NotificationBubble(props: Props) {
const { unseenCount, inline = false, user } = props; const { unseenCount, inline = false, user } = props;
const notificationsEnabled = ENABLE_UI_NOTIFICATIONS || (user && user.experimental_ui); const notificationsEnabled = ENABLE_UI_NOTIFICATIONS || (user && user.experimental_ui);