fix: remove dividers and add gap in card view
This commit is contained in:
1 parent
3191bd23e5
commit
e0aafca7b3
4 files changed
+11
-23
No files matched your search
@@ -19,7 +19,6 @@
|
|||||||
>
|
>
|
||||||
<div class="flex flex-row justify-between items-center">
|
<div class="flex flex-row justify-between items-center">
|
||||||
<PostMeta
|
<PostMeta
|
||||||
community={comment.community}
|
|
||||||
deleted={false}
|
deleted={false}
|
||||||
featured={false}
|
featured={false}
|
||||||
nsfw={comment.post.nsfw}
|
nsfw={comment.post.nsfw}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
||||||
import { Button, Material } from 'mono-svelte'
|
import { Button, Material } from 'mono-svelte'
|
||||||
|
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
||||||
|
import { userSettings } from '$lib/settings.js'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
|
|
||||||
@@ -18,7 +20,9 @@
|
|||||||
|
|
||||||
<h1 class="text-2xl font-bold">Saved</h1>
|
<h1 class="text-2xl font-bold">Saved</h1>
|
||||||
<div
|
<div
|
||||||
class="flex flex-col gap-4 list-none my-4 !divide-y divide-slate-200 dark:divide-zinc-800"
|
class="flex flex-col list-none my-4 divide-slate-200 dark:divide-zinc-800"
|
||||||
|
class:gap-4={$userSettings.view == 'card'}
|
||||||
|
class:!divide-y={$userSettings.view != 'card'}
|
||||||
>
|
>
|
||||||
{#if !data.data || (data.data?.length ?? 0) == 0}
|
{#if !data.data || (data.data?.length ?? 0) == 0}
|
||||||
<p class="text-center opacity-60 text-lg mx-4">
|
<p class="text-center opacity-60 text-lg mx-4">
|
||||||
@@ -28,25 +32,7 @@
|
|||||||
{#each data.data as item, index}
|
{#each data.data as item, index}
|
||||||
<div in:fly={{ opacity: 0, y: -4, delay: index * 50 }}>
|
<div in:fly={{ opacity: 0, y: -4, delay: index * 50 }}>
|
||||||
{#if isComment(item)}
|
{#if isComment(item)}
|
||||||
<Material padding="lg" color="distinct" class="flex flex-col flex-1">
|
<CommentItem comment={item} />
|
||||||
<div class="flex flex-row items-center">
|
|
||||||
<PostMeta
|
|
||||||
title={item.post.name}
|
|
||||||
id={item.post.id}
|
|
||||||
published={new Date(item.post.published)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="list-none">
|
|
||||||
<Comment
|
|
||||||
postId={item.post.id}
|
|
||||||
node={{ children: [], comment_view: item, depth: 1 }}
|
|
||||||
replying={false}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<Button class="ml-auto" href="/comment/{item.comment.id}">
|
|
||||||
Jump
|
|
||||||
</Button>
|
|
||||||
</Material>
|
|
||||||
{:else}
|
{:else}
|
||||||
<Post post={item} />
|
<Post post={item} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
isPostView,
|
isPostView,
|
||||||
isUser,
|
isUser,
|
||||||
} from '$lib/lemmy/item.js'
|
} from '$lib/lemmy/item.js'
|
||||||
|
import { userSettings } from '$lib/settings.js'
|
||||||
import { searchParam } from '$lib/util.js'
|
import { searchParam } from '$lib/util.js'
|
||||||
import type {
|
import type {
|
||||||
CommentView,
|
CommentView,
|
||||||
@@ -119,7 +120,9 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{/await}
|
{/await}
|
||||||
<div
|
<div
|
||||||
class="flex flex-col mt-4 !divide-y divide-slate-200 dark:divide-zinc-800"
|
class="flex flex-col mt-4 divide-slate-200 dark:divide-zinc-800"
|
||||||
|
class:!divide-y={$userSettings.view != 'card'}
|
||||||
|
class:gap-4={$userSettings.view == 'card'}
|
||||||
>
|
>
|
||||||
{#each data.results as result}
|
{#each data.results as result}
|
||||||
{#if isPostView(result)}
|
{#if isPostView(result)}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export async function load({ url, fetch }) {
|
|||||||
q: query,
|
q: query,
|
||||||
auth: get(profile)?.jwt,
|
auth: get(profile)?.jwt,
|
||||||
community_id: community ?? undefined,
|
community_id: community ?? undefined,
|
||||||
limit: 40,
|
limit: 20,
|
||||||
page: page,
|
page: page,
|
||||||
sort: (sort as SortType) || 'New',
|
sort: (sort as SortType) || 'New',
|
||||||
listing_type: 'All',
|
listing_type: 'All',
|
||||||
|
|||||||
Reference in new issue
Block a user