From d883220c93a72ec29d70e05388c3c7f47e8472be Mon Sep 17 00:00:00 2001 From: codytseng Date: Thu, 7 Nov 2024 22:30:32 +0800 Subject: [PATCH] style: make minor adjustments to styling --- .../components/Embedded/EmbeddedMention.tsx | 2 +- src/renderer/src/components/Nip05/index.tsx | 31 ++++++++++--------- .../components/NoteCard/ShortTextNoteCard.tsx | 6 ++-- .../src/components/NoteStats/LikeButton.tsx | 8 +++-- .../src/components/NoteStats/RepostButton.tsx | 4 +-- .../src/components/ReplyNote/index.tsx | 6 ++-- .../src/components/Username/index.tsx | 2 +- 7 files changed, 34 insertions(+), 25 deletions(-) diff --git a/src/renderer/src/components/Embedded/EmbeddedMention.tsx b/src/renderer/src/components/Embedded/EmbeddedMention.tsx index e1049bf3..1af0b227 100644 --- a/src/renderer/src/components/Embedded/EmbeddedMention.tsx +++ b/src/renderer/src/components/Embedded/EmbeddedMention.tsx @@ -1,5 +1,5 @@ import Username from '../Username' export function EmbeddedMention({ userId }: { userId: string }) { - return + return } diff --git a/src/renderer/src/components/Nip05/index.tsx b/src/renderer/src/components/Nip05/index.tsx index 39f6b936..887a5560 100644 --- a/src/renderer/src/components/Nip05/index.tsx +++ b/src/renderer/src/components/Nip05/index.tsx @@ -4,19 +4,22 @@ import { BadgeAlert, BadgeCheck } from 'lucide-react' export default function Nip05({ nip05, pubkey }: { nip05: string; pubkey: string }) { const { nip05IsVerified, nip05Name, nip05Domain } = useFetchNip05(nip05, pubkey) return ( -
- {nip05Name !== '_' ? ( -
@{nip05Name}
- ) : null} - - {nip05IsVerified ? : } -
{nip05Domain}
-
-
+ nip05Name && + nip05Domain && ( +
+ {nip05Name !== '_' ? ( +
@{nip05Name}
+ ) : null} + + {nip05IsVerified ? : } +
{nip05Domain}
+
+
+ ) ) } diff --git a/src/renderer/src/components/NoteCard/ShortTextNoteCard.tsx b/src/renderer/src/components/NoteCard/ShortTextNoteCard.tsx index 61899fd0..ddbce121 100644 --- a/src/renderer/src/components/NoteCard/ShortTextNoteCard.tsx +++ b/src/renderer/src/components/NoteCard/ShortTextNoteCard.tsx @@ -9,7 +9,7 @@ import { getParentEventId, getRootEventId } from '@renderer/lib/event' export default function ShortTextNoteCard({ event, className, - size, + size = 'normal', hideStats = false }: { event: Event @@ -29,7 +29,9 @@ export default function ShortTextNoteCard({ push(toNote(rootEvent ?? event)) }} > - + - + {liking ? ( + + ) : ( + + )}
{formatCount(likeCount)}
) diff --git a/src/renderer/src/components/NoteStats/RepostButton.tsx b/src/renderer/src/components/NoteStats/RepostButton.tsx index 88b3578c..42de65e3 100644 --- a/src/renderer/src/components/NoteStats/RepostButton.tsx +++ b/src/renderer/src/components/NoteStats/RepostButton.tsx @@ -14,7 +14,7 @@ import { cn } from '@renderer/lib/utils' import { useNostr } from '@renderer/providers/NostrProvider' import { useNoteStats } from '@renderer/providers/NoteStatsProvider' import client from '@renderer/services/client.service' -import { Repeat } from 'lucide-react' +import { Loader, Repeat } from 'lucide-react' import { Event } from 'nostr-tools' import { useEffect, useMemo, useState } from 'react' import { formatCount } from './utils' @@ -85,7 +85,7 @@ export default function RepostButton({ disabled={!canRepost} title="repost" > - + {reposting ? : }
{formatCount(repostCount)}
diff --git a/src/renderer/src/components/ReplyNote/index.tsx b/src/renderer/src/components/ReplyNote/index.tsx index 215a54c6..ff403ca6 100644 --- a/src/renderer/src/components/ReplyNote/index.tsx +++ b/src/renderer/src/components/ReplyNote/index.tsx @@ -22,12 +22,12 @@ export default function ReplyNote({ >
-
+
-
+
{formatTimestamp(event.created_at)}
diff --git a/src/renderer/src/components/Username/index.tsx b/src/renderer/src/components/Username/index.tsx index 59343f74..99d362a4 100644 --- a/src/renderer/src/components/Username/index.tsx +++ b/src/renderer/src/components/Username/index.tsx @@ -20,7 +20,7 @@ export default function Username({ return ( -
+