diff --git a/src/components/channels/channelListItem.tsx b/src/components/channels/channelListItem.tsx index 75170737..b175ccc4 100644 --- a/src/components/channels/channelListItem.tsx +++ b/src/components/channels/channelListItem.tsx @@ -1,20 +1,15 @@ +import { ActiveLink } from '@components/activeLink'; import { ImageWithFallback } from '@components/imageWithFallback'; import { DEFAULT_AVATAR } from '@stores/constants'; -import { useRouter } from 'next/navigation'; - export const ChannelListItem = ({ data }: { data: any }) => { - const router = useRouter(); const channel = JSON.parse(data.content); - const openChannel = (id: string) => { - router.push(`/channels/${id}`); - }; - return ( -
openChannel(data.eventId)} +
@@ -28,6 +23,6 @@ export const ChannelListItem = ({ data }: { data: any }) => {
{channel.name}
-
+
); }; diff --git a/src/components/chats/chatListItem.tsx b/src/components/chats/chatListItem.tsx index b192173b..c6888e90 100644 --- a/src/components/chats/chatListItem.tsx +++ b/src/components/chats/chatListItem.tsx @@ -1,3 +1,4 @@ +import { ActiveLink } from '@components/activeLink'; import { ImageWithFallback } from '@components/imageWithFallback'; import { DEFAULT_AVATAR } from '@stores/constants'; @@ -5,19 +6,13 @@ import { DEFAULT_AVATAR } from '@stores/constants'; import { useProfileMetadata } from '@utils/hooks/useProfileMetadata'; import { truncate } from '@utils/truncate'; -import { useRouter } from 'next/navigation'; - export const ChatListItem = ({ pubkey }: { pubkey: string }) => { - const router = useRouter(); const profile = useProfileMetadata(pubkey); - const openChat = () => { - router.push(`/chats/${pubkey}`); - }; - return ( -
openChat()} +
@@ -33,6 +28,6 @@ export const ChatListItem = ({ pubkey }: { pubkey: string }) => { {profile?.display_name || profile?.name || truncate(pubkey, 16, ' .... ')}
-
+ ); };