mirror of
https://github.com/aljazceru/rabbit.git
synced 2025-12-18 14:34:25 +01:00
feat: lazy load icons
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { Component, JSX, Show, createSignal } from 'solid-js';
|
import { Component, JSX, Show, createSignal } from 'solid-js';
|
||||||
|
|
||||||
|
import LazyLoad from '@/components/utils/LazyLoad';
|
||||||
import useDetectOverflow from '@/hooks/useDetectOverflow';
|
import useDetectOverflow from '@/hooks/useDetectOverflow';
|
||||||
import useFormatDate from '@/hooks/useFormatDate';
|
import useFormatDate from '@/hooks/useFormatDate';
|
||||||
import { useTranslation } from '@/i18n/useTranslation';
|
import { useTranslation } from '@/i18n/useTranslation';
|
||||||
@@ -41,7 +42,11 @@ const Post: Component<PostProps> = (props) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Show when={author()?.picture} keyed>
|
<Show when={author()?.picture} keyed>
|
||||||
{(url) => <img src={url} alt="icon" class="h-full w-full rounded object-cover" />}
|
{(url) => (
|
||||||
|
<LazyLoad>
|
||||||
|
{() => <img src={url} alt="icon" class="h-full w-full rounded object-cover" />}
|
||||||
|
</LazyLoad>
|
||||||
|
)}
|
||||||
</Show>
|
</Show>
|
||||||
</button>
|
</button>
|
||||||
<div class="min-w-0 flex-auto">
|
<div class="min-w-0 flex-auto">
|
||||||
|
|||||||
Reference in New Issue
Block a user