feat: add loading animation to search/community pages

This commit is contained in:
James Xylight committed 2025-02-09 15:06:02 -08:00
1 parent d8e916d526
commit 9e1db2ea83
9 files changed
+169 -253

No files matched your search

@@ -5,10 +5,14 @@
import {
ChatBubbleOvalLeftEllipsis,
Check,
ExclamationTriangle,
Icon,
InformationCircle,
MapPin,
NoSymbol,
PencilSquare,
Plus,
Trash,
UserGroup,
} from 'svelte-hero-icons'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
@@ -78,7 +82,43 @@
class="flex flex-col overflow-hidden whitespace-nowrap flex-1 min-w-0 flex-shrink"
>
<div class="font-medium text-base overflow-hidden overflow-ellipsis">
{community.community.title}
<span>{community.community.title}</span>
{#if community.community.deleted}
<Icon
src={Trash}
class="text-red-500"
micro
size="14"
title={$t('post.badges.deleted')}
/>
{/if}
{#if community.community.nsfw}
<Icon
src={ExclamationTriangle}
class="text-red-500"
micro
size="14"
title={$t('post.badges.nsfw')}
/>
{/if}
{#if community.banned_from_community}
<Icon
src={NoSymbol}
class="text-red-500"
micro
size="14"
title={$t('comment.banned')}
/>
{/if}
{#if community.community.visibility == 'LocalOnly'}
<Icon
src={MapPin}
class="text-green-500"
micro
size="14"
title={$t('routes.admin.config.listingType.local')}
/>
{/if}
</div>
<div
class="text-sm text-slate-600 dark:text-zinc-400 flex gap-0.5"
@@ -47,11 +47,9 @@
Spinner,
toast,
} from 'mono-svelte'
import { fediseer, type Data } from '$lib/fediseer/fediseer'
import { t } from '$lib/translations'
import { hidePost, postLink } from './helpers'
import { feature } from '$lib/version'
import Switch from '$lib/components/input/Switch.svelte'
import { instanceId, instanceToURL } from '$lib/util.svelte'
import { publishedToDate } from '$lib/components/util/date'
import TextProps from '$lib/components/ui/text/TextProps.svelte'
@@ -0,0 +1,11 @@
<div class="skeleton animate-pulse flex flex-col gap-2 w-full">
<div
class="w-2/3 h-6 bg-slate-300 dark:bg-zinc-700 animate-pulse rounded-md"
></div>
<div
class="w-full h-20 bg-slate-300 dark:bg-zinc-700 animate-pulse rounded-md"
></div>
<div
class="w-32 h-6 bg-slate-300 dark:bg-zinc-700 animate-pulse rounded-md"
></div>
</div>