From 29d40ed4066c4ddf88d7a3fc97ec08bdcb919f17 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Wed, 19 Jul 2023 17:07:25 +0700 Subject: [PATCH] render reply and sub reply accordingly --- src/app/space/components/blocks/thread.tsx | 8 ++-- src/shared/accounts/active.tsx | 2 +- src/shared/notes/actions.tsx | 2 +- src/shared/notes/index.tsx | 1 + src/shared/notes/mentions/note.tsx | 2 +- src/shared/notes/preview/image.tsx | 2 +- src/shared/notes/preview/link.tsx | 2 +- src/shared/notes/preview/video.tsx | 2 +- src/shared/notes/replies/form.tsx | 31 ++++++++++--- src/shared/notes/replies/item.tsx | 20 ++++++--- src/shared/notes/replies/list.tsx | 52 ++++++++++++++++------ src/shared/notes/replies/sub.tsx | 24 ++++++++++ src/utils/hooks/useProfile.tsx | 3 ++ src/utils/types.d.ts | 1 + 14 files changed, 118 insertions(+), 34 deletions(-) create mode 100644 src/shared/notes/replies/sub.tsx diff --git a/src/app/space/components/blocks/thread.tsx b/src/app/space/components/blocks/thread.tsx index b0a664c0..0946cd06 100644 --- a/src/app/space/components/blocks/thread.tsx +++ b/src/app/space/components/blocks/thread.tsx @@ -10,11 +10,13 @@ import { RepliesList } from '@shared/notes/replies/list'; import { NoteSkeleton } from '@shared/notes/skeleton'; import { TitleBar } from '@shared/titleBar'; +import { useAccount } from '@utils/hooks/useAccount'; import { useEvent } from '@utils/hooks/useEvent'; import { Block } from '@utils/types'; export function ThreadBlock({ params }: { params: Block }) { const { status, data } = useEvent(params.content); + const { account } = useAccount(); // subscribe to live reply // useLiveThread(params.content); @@ -22,7 +24,7 @@ export function ThreadBlock({ params }: { params: Block }) { return (
Loading...
Reply as
++ {user?.nip05 || user?.name || displayNpub(pubkey, 16)} +
+