diff --git a/src/components/channels/channelListItem.tsx b/src/components/channels/channelListItem.tsx index 73c99d7d..86219c29 100644 --- a/src/components/channels/channelListItem.tsx +++ b/src/components/channels/channelListItem.tsx @@ -6,15 +6,7 @@ import { usePageContext } from '@utils/hooks/usePageContext'; import { twMerge } from 'tailwind-merge'; export const ChannelListItem = ({ data }: { data: any }) => { - let fallback: any; - - if (typeof data.metadata === 'object') { - fallback = data.metadata; - } else { - fallback = JSON.parse(data.metadata); - } - - const channel: any = useChannelMetadata(data.event_id, fallback); + const channel: any = useChannelMetadata(data.event_id); const pageContext = usePageContext(); const searchParams: any = pageContext.urlParsed.search; diff --git a/src/components/channels/channelProfile.tsx b/src/components/channels/channelProfile.tsx new file mode 100644 index 00000000..e8f43166 --- /dev/null +++ b/src/components/channels/channelProfile.tsx @@ -0,0 +1,23 @@ +import { useChannelMetadata } from '@utils/hooks/useChannelMetadata'; + +import { nip19 } from 'nostr-tools'; +import Skeleton from 'react-loading-skeleton'; + +export const ChannelProfile = ({ id }: { id: string }) => { + const metadata = useChannelMetadata(id); + const noteID = nip19.noteEncode(id); + + return ( +
+ {metadata?.about || noteID.substring(0, 24) + '...' ||
Sorry, this feature under development, it will come in the next version
++ Sorry, this feature under development, it will come in the next version +
+