Fix emoji reactions display and remove stats border

- Map "+" and empty reactions to 👍 emoji so they appear in the stats row
- Remove border-top from stats row and date-only row to match Ditto

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
This commit is contained in:
shakespeare.diy
2026-02-16 21:30:31 -06:00
parent 29a143337b
commit cd194aa639
2 changed files with 7 additions and 5 deletions
+3 -1
View File
@@ -143,7 +143,9 @@ export function useEventStats(eventId: string | undefined) {
reactions++;
// Extract the emoji from the reaction content (kind 7 events use content for the emoji)
const emoji = e.content.trim();
if (emoji && emoji !== '+' && emoji !== '-') {
if (emoji === '+' || emoji === '') {
reactionEmojiSet.add('👍');
} else if (emoji !== '-') {
reactionEmojiSet.add(emoji);
}
break;
+4 -4
View File
@@ -175,9 +175,9 @@ function PostDetailContent({ event }: { event: NostrEvent }) {
</div>
)}
{/* Stats row: "2 Reposts 1 Like" left, "Feb 16, 2026, 6:44 PM" right — Ditto style */}
{/* Stats row: "2 Reposts 1 👍" left, "Feb 16, 2026, 6:44 PM" right — Ditto style */}
{hasStats && (
<div className="flex items-center gap-x-3 py-2.5 mt-3 border-t border-border text-sm text-muted-foreground">
<div className="flex items-center gap-x-3 py-2.5 mt-3 text-sm text-muted-foreground">
{stats?.reposts ? (
<span>
<span className="font-bold text-foreground">{stats.reposts}</span>{' '}
@@ -204,7 +204,7 @@ function PostDetailContent({ event }: { event: NostrEvent }) {
{/* Date-only row if no stats */}
{!hasStats && (
<div className="py-2.5 mt-3 border-t border-border text-sm text-muted-foreground">
<div className="py-2.5 mt-3 text-sm text-muted-foreground">
{formatFullDate(event.created_at)}
</div>
)}
@@ -308,7 +308,7 @@ function PostDetailSkeleton() {
</div>
{/* Stats */}
<div className="flex gap-4 mt-3 pt-2.5 border-t border-border">
<div className="flex gap-4 mt-3 pt-2.5">
<Skeleton className="h-4 w-20" />
<Skeleton className="h-4 w-16" />
<Skeleton className="h-4 w-32 ml-auto" />