Skip to content

Commit

Permalink
Unclutter notifications view
Browse files Browse the repository at this point in the history
  • Loading branch information
hzrd149 committed Oct 3, 2024
1 parent 38bc52b commit e0e2ed9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-hotels-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nostrudel": minor
---

Unclutter notifications view
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,14 @@ const NotificationIconEntry = memo(
bg={!read ? focusColor : undefined}
ref={headerRef}
overflow="hidden"
_hover={{ backgroundColor: "var(--chakra-colors-card-hover-overlay)" }}
>
<Box>{icon}</Box>
<UserAvatar pubkey={pubkey} size="sm" />
<UserAvatar pubkey={pubkey} hideFrom="md" size="sm" />
<UserName pubkey={pubkey} hideBelow="md" />
<Text isTruncated>{summary}</Text>
<Text isTruncated color={read ? "GrayText" : undefined}>
{summary}
</Text>
<Spacer />
{read && <CheckIcon boxSize={5} color="green.500" />}
<Timestamp timestamp={timestamp} whiteSpace="pre" />
Expand Down
14 changes: 8 additions & 6 deletions src/views/notifications/components/notification-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const ReplyNotification = forwardRef<HTMLDivElement, { event: NostrEvent; onClic
return (
<NotificationIconEntry
ref={ref}
icon={<ReplyIcon boxSize={8} color="green.400" />}
icon={<ReplyIcon boxSize={6} color="green.400" />}
id={event.id}
pubkey={event.pubkey}
timestamp={event.created_at}
Expand Down Expand Up @@ -101,7 +101,7 @@ const MentionNotification = forwardRef<HTMLDivElement, { event: NostrEvent; onCl
return (
<NotificationIconEntry
ref={ref}
icon={<AtIcon boxSize={8} color="purple.400" />}
icon={<AtIcon boxSize={6} color="purple.400" />}
id={event.id}
pubkey={event.pubkey}
timestamp={event.created_at}
Expand All @@ -122,7 +122,7 @@ const RepostNotification = forwardRef<HTMLDivElement, { event: NostrEvent; onCli
return (
<NotificationIconEntry
ref={ref}
icon={<RepostIcon boxSize={8} color="blue.400" />}
icon={<RepostIcon boxSize={6} color="blue.400" />}
id={event.id}
pubkey={event.pubkey}
timestamp={event.created_at}
Expand Down Expand Up @@ -150,14 +150,16 @@ const ReactionNotification = forwardRef<HTMLDivElement, { event: NostrEvent; onC
return (
<NotificationIconEntry
ref={ref}
icon={<Heart boxSize={8} color="red.400" />}
icon={<Heart boxSize={6} color="red.400" />}
id={event.id}
pubkey={event.pubkey}
timestamp={event.created_at}
summary={
<>
<ReactionIcon emoji={event.content} />
{reactedEvent?.content}
<Text fontStyle="italic" as="span" ml="2" mr="2" fontSize="sm">
{reactedEvent?.content}
</Text>
</>
}
onClick={onClick}
Expand Down Expand Up @@ -207,7 +209,7 @@ const ZapNotification = forwardRef<HTMLDivElement, { event: NostrEvent; onClick?
return (
<NotificationIconEntry
ref={ref}
icon={<LightningIcon boxSize={8} color="yellow.400" />}
icon={<LightningIcon boxSize={6} color="yellow.400" />}
id={event.id}
pubkey={zap.request.pubkey}
timestamp={zap.request.created_at}
Expand Down

0 comments on commit e0e2ed9

Please sign in to comment.