design: replace crosspost disclosure with expandable

This commit is contained in:
Xylight committed 2024-03-16 16:09:07 -07:00
1 parent 0c47988b19
commit 2c164ca548
2 files changed
+10 -10

No files matched your search

+4 -4
View File
@@ -6,12 +6,12 @@
<Disclosure <Disclosure
bind:open bind:open
class="items-start justify-items-start gap-2 hover:text-primary-900 class="items-start justify-items-start gap-2 {$$props.class}"
hover:dark:text-primary-100 transition-colors {$$props.class}"
> >
<div <div
slot="summary" slot="summary"
class="font-medium w-full text-left flex flex-row items-center justify-between" class="font-medium w-full text-left flex flex-row items-center justify-between hover:text-primary-900
hover:dark:text-primary-100 transition-colors"
> >
<div class="flex flex-row gap-1 items-center w-full"> <div class="flex flex-row gap-1 items-center w-full">
<slot name="title" /> <slot name="title" />
@@ -23,7 +23,7 @@
class="{open ? 'rotate-180' : ''} transition-transform" class="{open ? 'rotate-180' : ''} transition-transform"
/> />
</div> </div>
<div class="pt-2"> <div class="pt-2 text-slate-900 dark:text-zinc-100">
<slot /> <slot />
</div> </div>
</Disclosure> </Disclosure>
@@ -47,6 +47,7 @@
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte' import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
import { mediaType } from '$lib/components/lemmy/post/helpers.js' import { mediaType } from '$lib/components/lemmy/post/helpers.js'
import Post from '$lib/components/lemmy/post/Post.svelte' import Post from '$lib/components/lemmy/post/Post.svelte'
import Expandable from '$lib/components/ui/Expandable.svelte'
export let data export let data
@@ -145,7 +146,7 @@
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
{#if $page.params.instance?.toLowerCase() != $instance.toLowerCase()} {#if $page.params.instance?.toLowerCase() != $instance.toLowerCase()}
<Material <Material
class="p-4 flex flex-col gap-1 border class="p-4 flex flex-row gap-1 border
border-yellow-300 dark:bg-yellow-950/30 dark:border-yellow-900 bg-yellow-50" border-yellow-300 dark:bg-yellow-950/30 dark:border-yellow-900 bg-yellow-50"
> >
<Icon <Icon
@@ -154,8 +155,7 @@
solid solid
class="text-yellow-500" class="text-yellow-500"
/> />
<h1 class="font-bold">Warning</h1> <p class="text-sm text-yellow-700 dark:text-yellow-300">
<p class="text-sm">
This URL is for a different instance than you're logged into. You This URL is for a different instance than you're logged into. You
probably won't be able to vote or comment. probably won't be able to vote or comment.
</p> </p>
@@ -213,12 +213,12 @@
/> />
</div> </div>
{#if post.cross_posts?.length > 0} {#if post.cross_posts?.length > 0}
<Disclosure <Expandable
class="text-base mt-2 w-full cursor-pointer" class="text-base mt-2 w-full cursor-pointer"
open={post.cross_posts?.length <= 3} open={post.cross_posts?.length <= 3}
> >
<div <div
slot="summary" slot="title"
class="inline-block w-full text-left text-base font-normal" class="inline-block w-full text-left text-base font-normal"
> >
<span class="font-bold">{post.cross_posts.length}</span> <span class="font-bold">{post.cross_posts.length}</span>
@@ -231,7 +231,7 @@
<Post view="compact" actions={false} post={crosspost} /> <Post view="compact" actions={false} post={crosspost} />
{/each} {/each}
</div> </div>
</Disclosure> </Expandable>
{/if} {/if}
</div> </div>
{#if data.singleThread} {#if data.singleThread}