feat: use thumbnail of profile pic in post

This commit is contained in:
Shusui MOYATANI
2024-01-07 16:47:01 +09:00
parent 788b80224b
commit b82b925053

View File

@@ -6,6 +6,7 @@ import useFormatDate from '@/hooks/useFormatDate';
import { useTranslation } from '@/i18n/useTranslation'; import { useTranslation } from '@/i18n/useTranslation';
import useProfile from '@/nostr/useProfile'; import useProfile from '@/nostr/useProfile';
import npubEncodeFallback from '@/utils/npubEncodeFallback'; import npubEncodeFallback from '@/utils/npubEncodeFallback';
import { thumbnailUrl } from '@/utils/url';
export type PostProps = { export type PostProps = {
authorPubkey: string; authorPubkey: string;
@@ -44,7 +45,9 @@ const Post: Component<PostProps> = (props) => {
<Show when={author()?.picture} keyed> <Show when={author()?.picture} keyed>
{(url) => ( {(url) => (
<LazyLoad> <LazyLoad>
{() => <img src={url} alt="icon" class="h-full w-full object-cover" />} {() => (
<img src={thumbnailUrl(url)} alt="icon" class="h-full w-full object-cover" />
)}
</LazyLoad> </LazyLoad>
)} )}
</Show> </Show>