cleanup: improve reacvtivity on post page, remove useless community icon

This commit is contained in:
James Xylight committed 2025-02-04 16:56:50 -08:00
1 parent 8fcb8af015
commit 6b64e0f59f
7 files changed
+22 -76

No files matched your search

@@ -60,12 +60,14 @@
</div>
<Button
color="primary"
rounding="pill"
size="sm"
href="/post/{comment.post.id}?thread={comment.comment.path}#{comment
.comment.id}"
class="self-start"
>
{$t('common.jump')}
<Icon src={ArrowUturnUp} size="16" micro />
<Icon src={ArrowUturnUp} size="14" micro />
</Button>
</div>
{/if}
+7 -32
View File
@@ -72,8 +72,6 @@
import CommunityHeader from '../community/CommunityHeader.svelte'
import { publishedToDate } from '$lib/components/util/date'
let popoverOpen = $state(false)
interface Props {
community?: Community | undefined
showCommunity?: boolean
@@ -132,36 +130,13 @@
class:compact={view == 'compact'}
{style}
>
{#if showCommunity && community != undefined && subscribed}
<Popover bind:open={popoverOpen} manual>
{#snippet target()}
<button
onclick={() => (popoverOpen = !popoverOpen)}
class="relative cursor-pointer row-span-2 flex-shrink-0 pr-2 group/community"
>
<Avatar
url={community?.icon}
width={view == 'compact' ? 24 : 32}
alt={community?.name}
class="group-hover/community:ring-2 transition-all ring-offset-0 ring-primary-900 dark:ring-primary-100"
/>
</button>
{/snippet}
<!-- svelte-ignore a11y_click_events_have_key_events -->
<!-- svelte-ignore a11y_no_static_element_interactions -->
{#snippet popover()}
{#if community && subscribed}
<div
class="max-w-md rounded-2xl bg-white dark:bg-zinc-950"
onclick={stopPropagation(() => {})}
>
<CommunityHeader bind:community bind:subscribed />
</div>
{/if}
{/snippet}
</Popover>
<!-- svelte-ignore a11y_click_events_have_key_events -->
<!-- svelte-ignore a11y_no_static_element_interactions -->
{#if showCommunity && community}
<Avatar
url={community?.icon}
width={view == 'compact' ? 24 : 32}
alt={community?.name}
class="row-span-2 flex-shrink-0 mr-2"
/>
{/if}
{#if showCommunity && community}
<CommunityLink
@@ -29,7 +29,7 @@
"
style="{pageHeader
? `margin-top: min(-6rem, calc(-1 * calc(${$contentPadding.top}px))); padding-top: max(6rem, calc(${$contentPadding.top}px));`
? `margin-top: min(-12rem, calc(-1 * calc(${$contentPadding.top}px))); padding-top: max(12rem, calc(${$contentPadding.top}px));`
: ''} {style};
"
>
@@ -194,7 +194,6 @@
<hr class="dark:opacity-10 w-[90%] my-2 mx-auto" />
<li class="flex flex-col px-2 py-1 mx-auto my-1 text-xs w-full">
<div class="flex flex-row gap-2 w-full items-center">
<!-- svelte-ignore missing_declaration -->
<div class="flex-1">
<button
class="hover:brightness-110 transition-all"