feat(SampleList): remove text loader and add a prop isLoading
This commit is contained in:
@@ -50,11 +50,9 @@ const displayRange = $derived.by(() => {
|
|||||||
const loadedCount = Math.min(offset + limit, total);
|
const loadedCount = Math.min(offset + limit, total);
|
||||||
return `Showing ${loadedCount} of ${total} fonts`;
|
return `Showing ${loadedCount} of ${total} fonts`;
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
|
|
||||||
{#if unifiedFontStore.isFetching || unifiedFontStore.isLoading}
|
const isLoading = $derived(unifiedFontStore.isFetching || unifiedFontStore.isLoading);
|
||||||
<span class="ml-2 text-xs text-muted-foreground/70">(Loading...)</span>
|
</script>
|
||||||
{/if}
|
|
||||||
|
|
||||||
<FontVirtualList
|
<FontVirtualList
|
||||||
items={unifiedFontStore.fonts}
|
items={unifiedFontStore.fonts}
|
||||||
@@ -63,8 +61,15 @@ const displayRange = $derived.by(() => {
|
|||||||
itemHeight={280}
|
itemHeight={280}
|
||||||
useWindowScroll={true}
|
useWindowScroll={true}
|
||||||
weight={controlManager.weight}
|
weight={controlManager.weight}
|
||||||
|
{isLoading}
|
||||||
>
|
>
|
||||||
{#snippet children({ item: font, isFullyVisible, isPartiallyVisible, proximity, index })}
|
{#snippet children({
|
||||||
|
item: font,
|
||||||
|
isFullyVisible,
|
||||||
|
isPartiallyVisible,
|
||||||
|
proximity,
|
||||||
|
index,
|
||||||
|
})}
|
||||||
<FontListItem {font} {isFullyVisible} {isPartiallyVisible} {proximity}>
|
<FontListItem {font} {isFullyVisible} {isPartiallyVisible} {proximity}>
|
||||||
<FontSampler {font} bind:text {index} />
|
<FontSampler {font} bind:text {index} />
|
||||||
</FontListItem>
|
</FontListItem>
|
||||||
|
|||||||
Reference in New Issue
Block a user