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);
|
||||
return `Showing ${loadedCount} of ${total} fonts`;
|
||||
});
|
||||
</script>
|
||||
|
||||
{#if unifiedFontStore.isFetching || unifiedFontStore.isLoading}
|
||||
<span class="ml-2 text-xs text-muted-foreground/70">(Loading...)</span>
|
||||
{/if}
|
||||
const isLoading = $derived(unifiedFontStore.isFetching || unifiedFontStore.isLoading);
|
||||
</script>
|
||||
|
||||
<FontVirtualList
|
||||
items={unifiedFontStore.fonts}
|
||||
@@ -63,8 +61,15 @@ const displayRange = $derived.by(() => {
|
||||
itemHeight={280}
|
||||
useWindowScroll={true}
|
||||
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}>
|
||||
<FontSampler {font} bind:text {index} />
|
||||
</FontListItem>
|
||||
|
||||
Reference in New Issue
Block a user