fixed some performance issues

This commit is contained in:
Ren Amamiya
2023-04-21 15:13:33 +07:00
parent f8dff5f81e
commit 9fdf2eb81c
12 changed files with 71 additions and 62 deletions

View File

@@ -4,20 +4,9 @@ import { DEFAULT_AVATAR, DEFAULT_CHANNEL_BANNER } from '@stores/constants';
import { useChannelMetadata } from '@utils/hooks/useChannelMetadata';
import { useRouter } from 'next/navigation';
import { useCallback } from 'react';
export const BrowseChannelItem = ({ data }: { data: any }) => {
const router = useRouter();
const channel = useChannelMetadata(data.event_id, data.metadata);
const openChannel = useCallback(
(id: string) => {
router.push(`/nostr/channels/${id}`);
},
[router]
);
return (
<div className="h-64 w-full rounded-md bg-zinc-900">
<div className="relative h-24">