diff --git a/src/app/channel/pages/index.page.tsx b/src/app/channel/pages/index.page.tsx index 312ac888..33028d3d 100644 --- a/src/app/channel/pages/index.page.tsx +++ b/src/app/channel/pages/index.page.tsx @@ -53,7 +53,7 @@ export function Page() { const now = useRef(new Date()); - useSWRSubscription(channelID && muted && hided ? ['channel', channelID] : null, ([, key], {}: any) => { + useSWRSubscription(account && channelID && muted && hided ? ['channel', channelID] : null, ([, key], {}: any) => { // subscribe to channel const unsubscribe = pool.subscribe( [ diff --git a/src/app/chat/pages/index.page.tsx b/src/app/chat/pages/index.page.tsx index 0455d830..6aa20758 100644 --- a/src/app/chat/pages/index.page.tsx +++ b/src/app/chat/pages/index.page.tsx @@ -27,7 +27,7 @@ export function Page() { const setChatMessages = useSetAtom(chatMessagesAtom); const resetChatMessages = useResetAtom(chatMessagesAtom); - useSWRSubscription(pubkey ? ['chat', pubkey] : null, ([, key], {}: any) => { + useSWRSubscription(account ? ['chat', pubkey] : null, ([, key], {}: any) => { const unsubscribe = pool.subscribe( [ { diff --git a/src/app/note/components/user/default.tsx b/src/app/note/components/user/default.tsx index f5a8230b..91b9eb1a 100644 --- a/src/app/note/components/user/default.tsx +++ b/src/app/note/components/user/default.tsx @@ -5,8 +5,10 @@ import { DEFAULT_AVATAR, IMGPROXY_URL } from '@stores/constants'; import { useProfile } from '@utils/hooks/useProfile'; import { shortenKey } from '@utils/shortenKey'; +import { Popover, Transition } from '@headlessui/react'; import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; +import { Fragment } from 'react'; dayjs.extend(relativeTime); @@ -14,17 +16,17 @@ export function NoteDefaultUser({ pubkey, time }: { pubkey: string; time: number const { user } = useProfile(pubkey); return ( -
-
+ + {pubkey} -
+
-
+
{user?.display_name || user?.name ||
}
@@ -34,6 +36,59 @@ export function NoteDefaultUser({ pubkey, time }: { pubkey: string; time: number
-
+ + +
e.stopPropagation()} + className="w-full max-w-xs overflow-hidden rounded-lg border border-zinc-700 bg-zinc-900 shadow-input ring-1 ring-black ring-opacity-5" + > +
+ {pubkey} +
+
+
+ {user?.display_name || user?.name || ( +
+ )} +
+ + {user?.nip05 || shortenKey(pubkey)} + +
+
+

{user?.about}

+
+
+
+
+ + View full profile + + + Message + +
+
+
+
+ ); } diff --git a/src/app/note/components/user/repost.tsx b/src/app/note/components/user/repost.tsx index fd084296..576e2cd6 100644 --- a/src/app/note/components/user/repost.tsx +++ b/src/app/note/components/user/repost.tsx @@ -3,9 +3,12 @@ import { Image } from '@shared/image'; import { DEFAULT_AVATAR, IMGPROXY_URL } from '@stores/constants'; import { useProfile } from '@utils/hooks/useProfile'; +import { shortenKey } from '@utils/shortenKey'; +import { Popover, Transition } from '@headlessui/react'; import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; +import { Fragment } from 'react'; dayjs.extend(relativeTime); @@ -13,14 +16,14 @@ export function NoteRepostUser({ pubkey, time }: { pubkey: string; time: number const { user } = useProfile(pubkey); return ( -
-
+ + {pubkey} -
+
{user?.display_name || user?.name ||
} @@ -32,6 +35,59 @@ export function NoteRepostUser({ pubkey, time }: { pubkey: string; time: number ยท {dayjs().to(dayjs.unix(time), true)}
-
+ + +
e.stopPropagation()} + className="w-full max-w-xs overflow-hidden rounded-lg border border-zinc-700 bg-zinc-900 shadow-input ring-1 ring-black ring-opacity-5" + > +
+ {pubkey} +
+
+
+ {user?.display_name || user?.name || ( +
+ )} +
+ + {user?.nip05 || shortenKey(pubkey)} + +
+
+

{user?.about}

+
+
+
+
+ + View full profile + + + Message + +
+
+
+
+ ); }