impr: black out nsfw community icons, close #536
This commit is contained in:
2 files changed
+24
-8
No files matched your search
@@ -20,6 +20,7 @@
|
|||||||
Trash,
|
Trash,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
|
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
|
||||||
|
import { settings } from '$lib/settings.svelte'
|
||||||
|
|
||||||
let showInfo = $state(false)
|
let showInfo = $state(false)
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -65,11 +66,16 @@
|
|||||||
? 'flex-col gap-2'
|
? 'flex-col gap-2'
|
||||||
: 'flex-row'} gap-2 items-center"
|
: 'flex-row'} gap-2 items-center"
|
||||||
>
|
>
|
||||||
{#if icon}{@render icon()}{:else}
|
{#if icon}{@render icon()}{:else if community.community.nsfw && settings.nsfwBlur}
|
||||||
|
<div class="w-8 h-8 rounded-full bg-red-400"></div>
|
||||||
|
{:else}
|
||||||
<Avatar
|
<Avatar
|
||||||
url={community.community.icon}
|
url={community.community.icon}
|
||||||
width={32}
|
width={32}
|
||||||
alt={community.community.name}
|
alt={community.community.name}
|
||||||
|
class={[
|
||||||
|
community.community.nsfw && settings.nsfwBlur && 'blur-3xl',
|
||||||
|
]}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -150,13 +150,23 @@
|
|||||||
'bg-slate-200 dark:bg-zinc-800 rounded-lg cursor-pointer',
|
'bg-slate-200 dark:bg-zinc-800 rounded-lg cursor-pointer',
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Avatar
|
{#if community.nsfw && settings.nsfwBlur}
|
||||||
url={community?.icon}
|
<div
|
||||||
width={view == 'compact' ? 24 : 32}
|
style="width: {view == 'compact' ? 24 : 32}; height: {view ==
|
||||||
alt={community?.name}
|
'compact'
|
||||||
circle={false}
|
? 24
|
||||||
class="group-hover/btn:scale-90 group-active/btn:scale-[.85] transition-transform"
|
: 32}"
|
||||||
/>
|
class="bg-red-400 rounded-xl"
|
||||||
|
></div>
|
||||||
|
{:else}
|
||||||
|
<Avatar
|
||||||
|
url={community?.icon}
|
||||||
|
width={view == 'compact' ? 24 : 32}
|
||||||
|
alt={community?.name}
|
||||||
|
circle={false}
|
||||||
|
class="group-hover/btn:scale-90 group-active/btn:scale-[.85] transition-transform"
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet popover()}
|
{#snippet popover()}
|
||||||
|
|||||||
Reference in new issue
Block a user