fix: respect nsfw rules in compact mode

This commit is contained in:
Xylight committed 2024-10-07 17:46:31 -07:00
1 parent 1401e30a09
commit 6291e7e3d3
5 files changed
+64 -15

No files matched your search

@@ -1,7 +1,9 @@
<script lang="ts">
import Avatar from '$lib/components/ui/Avatar.svelte'
import { userSettings } from '$lib/settings.js'
import { t } from '$lib/translations'
import type { Community } from 'lemmy-js-client'
import { ExclamationTriangle, Icon } from 'svelte-hero-icons'
export let community: Community
@@ -10,6 +12,10 @@
export let avatarSize: number = 24
export let showInstance: boolean = $userSettings.showInstances.community
export let displayName: boolean = true
export let badges = {
nsfw: false,
}
</script>
<a
@@ -43,6 +49,17 @@
{/if}
</span>
{/if}
{#if badges}
{#if badges.nsfw}
<Icon
src={ExclamationTriangle}
size="14"
micro
title={$t('post.badges.nsfw')}
class="text-red-600 dark:text-red-400"
/>
{/if}
{/if}
</a>
<style>