Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Notifications] Add a Mentions tab #7044

Merged
merged 25 commits into from
Dec 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Highlight unread for all only
gaearon committed Dec 12, 2024
commit 34b61de2c17889b03f7ad45b75039938e70d92b0
3 changes: 2 additions & 1 deletion src/view/com/notifications/NotificationFeed.tsx
Original file line number Diff line number Diff line change
@@ -135,13 +135,14 @@ export function NotificationFeed({
}
return (
<NotificationFeedItem
highlightUnread={filter === 'all'}
item={item}
moderationOpts={moderationOpts!}
hideTopBorder={index === 0 && item.notification.isRead}
/>
)
},
[moderationOpts, _, onPressRetryLoadMore, pal.border],
[moderationOpts, _, onPressRetryLoadMore, pal.border, filter],
)

const FeedFooter = React.useCallback(
13 changes: 7 additions & 6 deletions src/view/com/notifications/NotificationFeedItem.tsx
Original file line number Diff line number Diff line change
@@ -79,10 +79,12 @@ interface Author {
let NotificationFeedItem = ({
item,
moderationOpts,
highlightUnread,
hideTopBorder,
}: {
item: FeedNotification
moderationOpts: ModerationOpts
highlightUnread: boolean
hideTopBorder?: boolean
}): React.ReactNode => {
const queryClient = useQueryClient()
@@ -151,6 +153,7 @@ let NotificationFeedItem = ({
if (!item.subject) {
return null
}
const isHighlighted = highlightUnread && !item.notification.isRead
return (
<Link
testID={`feedItem-by-${item.notification.author.handle}`}
@@ -160,12 +163,10 @@ let NotificationFeedItem = ({
<Post
post={item.subject}
style={
item.notification.isRead
? undefined
: {
backgroundColor: pal.colors.unreadNotifBg,
borderColor: pal.colors.unreadNotifBorder,
}
isHighlighted && {
backgroundColor: pal.colors.unreadNotifBg,
borderColor: pal.colors.unreadNotifBorder,
}
}
hideTopBorder={hideTopBorder}
/>