design: redesign inbox (again)
This commit is contained in:
1 parent
0d378ec248
commit
0d0681b687
13 files changed
+361
-281
No files matched your search
@@ -31,7 +31,9 @@
|
||||
export let node: CommentNodeI
|
||||
export let postId: number
|
||||
export let op: boolean = false
|
||||
|
||||
export let actions: boolean = true
|
||||
export let meta: boolean = true
|
||||
|
||||
export let open = true
|
||||
export let replying = false
|
||||
@@ -109,81 +111,83 @@
|
||||
: ''} {highlight} {$$props.class}"
|
||||
id={node.comment_view.comment.id.toString()}
|
||||
>
|
||||
<button
|
||||
on:click={() => (open = !open)}
|
||||
class="flex flex-row cursor-pointer gap-2 items-center group text-[13px] flex-wrap w-full
|
||||
{#if meta}
|
||||
<button
|
||||
on:click={() => (open = !open)}
|
||||
class="flex flex-row cursor-pointer gap-2 items-center group text-[13px] flex-wrap w-full
|
||||
z-0 group relative"
|
||||
>
|
||||
<div
|
||||
class="absolute opacity-0 -z-10 inset-0 group-hover:block group-hover:opacity-100
|
||||
bg-slate-100 dark:bg-zinc-900 group-hover:-inset-1 group-hover:-inset-x-2 rounded-full transition-all
|
||||
"
|
||||
>
|
||||
<div
|
||||
class="h-full flex items-center justify-center gap-1 ml-auto w-max mr-2"
|
||||
class="absolute opacity-0 -z-10 inset-0 group-hover:block group-hover:opacity-100
|
||||
bg-slate-100 dark:bg-zinc-900 group-hover:-inset-1 group-hover:-inset-x-2 rounded-full transition-all
|
||||
"
|
||||
>
|
||||
{#if node.children.length > 0}
|
||||
<FormattedNumber number={node.comment_view.counts.child_count}
|
||||
></FormattedNumber>
|
||||
{/if}
|
||||
<Icon
|
||||
src={open ? Minus : Plus}
|
||||
size="16"
|
||||
micro
|
||||
class="transition-transform duration-[400ms] ease-out {open
|
||||
? ''
|
||||
: 'rotate-90'} text-primary-900 dark:text-primary-100"
|
||||
/>
|
||||
<div
|
||||
class="h-full flex items-center justify-center gap-1 ml-auto w-max mr-2"
|
||||
>
|
||||
{#if node.children.length > 0}
|
||||
<FormattedNumber number={node.comment_view.counts.child_count}
|
||||
></FormattedNumber>
|
||||
{/if}
|
||||
<Icon
|
||||
src={open ? Minus : Plus}
|
||||
size="16"
|
||||
micro
|
||||
class="transition-transform duration-[400ms] ease-out {open
|
||||
? ''
|
||||
: 'rotate-90'} text-primary-900 dark:text-primary-100"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class:font-bold={op} class="flex flex-row gap-1 items-center">
|
||||
<UserLink
|
||||
inComment
|
||||
avatarSize={22}
|
||||
avatar
|
||||
user={node.comment_view.creator}
|
||||
>
|
||||
<svelte:fragment slot="badges">
|
||||
{#if node.comment_view.creator_is_moderator}
|
||||
<ShieldIcon filled width={14} class="text-green-500" />
|
||||
{/if}
|
||||
{#if node.comment_view.creator_is_admin}
|
||||
<ShieldIcon filled width={14} class="text-red-500" />
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
</UserLink>
|
||||
{#if op}
|
||||
<Icon mini size="16" src={Microphone} class="text-sky-600" />
|
||||
{/if}
|
||||
</span>
|
||||
<RelativeDate
|
||||
class="text-slate-600 dark:text-zinc-400"
|
||||
date={publishedToDate(node.comment_view.comment.published)}
|
||||
/>
|
||||
<span class="text-slate-600 dark:text-zinc-400 flex flex-row gap-2 ml-1">
|
||||
{#if node.comment_view.comment.updated}
|
||||
<Icon src={Pencil} solid size="12" title="Edited" />
|
||||
{/if}
|
||||
{#if node.comment_view.comment.deleted || node.comment_view.comment.removed}
|
||||
<Icon
|
||||
src={Trash}
|
||||
solid
|
||||
size="12"
|
||||
title={$t('post.badges.deleted')}
|
||||
class="text-red-600 dark:text-red-500"
|
||||
/>
|
||||
{/if}
|
||||
{#if node.comment_view.saved}
|
||||
<Icon
|
||||
src={Bookmark}
|
||||
solid
|
||||
size="12"
|
||||
title={$t('post.badges.saved')}
|
||||
class="text-yellow-600 dark:text-yellow-500"
|
||||
/>
|
||||
{/if}
|
||||
</span>
|
||||
</button>
|
||||
<span class:font-bold={op} class="flex flex-row gap-1 items-center">
|
||||
<UserLink
|
||||
inComment
|
||||
avatarSize={22}
|
||||
avatar
|
||||
user={node.comment_view.creator}
|
||||
>
|
||||
<svelte:fragment slot="badges">
|
||||
{#if node.comment_view.creator_is_moderator}
|
||||
<ShieldIcon filled width={14} class="text-green-500" />
|
||||
{/if}
|
||||
{#if node.comment_view.creator_is_admin}
|
||||
<ShieldIcon filled width={14} class="text-red-500" />
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
</UserLink>
|
||||
{#if op}
|
||||
<Icon mini size="16" src={Microphone} class="text-sky-600" />
|
||||
{/if}
|
||||
</span>
|
||||
<RelativeDate
|
||||
class="text-slate-600 dark:text-zinc-400"
|
||||
date={publishedToDate(node.comment_view.comment.published)}
|
||||
/>
|
||||
<span class="text-slate-600 dark:text-zinc-400 flex flex-row gap-2 ml-1">
|
||||
{#if node.comment_view.comment.updated}
|
||||
<Icon src={Pencil} solid size="12" title="Edited" />
|
||||
{/if}
|
||||
{#if node.comment_view.comment.deleted || node.comment_view.comment.removed}
|
||||
<Icon
|
||||
src={Trash}
|
||||
solid
|
||||
size="12"
|
||||
title={$t('post.badges.deleted')}
|
||||
class="text-red-600 dark:text-red-500"
|
||||
/>
|
||||
{/if}
|
||||
{#if node.comment_view.saved}
|
||||
<Icon
|
||||
src={Bookmark}
|
||||
solid
|
||||
size="12"
|
||||
title={$t('post.badges.saved')}
|
||||
class="text-yellow-600 dark:text-yellow-500"
|
||||
/>
|
||||
{/if}
|
||||
</span>
|
||||
</button>
|
||||
{/if}
|
||||
{#if open}
|
||||
<div transition:slide={{ duration: 400, easing: expoOut }}>
|
||||
<div
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
import { Button } from 'mono-svelte'
|
||||
import { t } from '$lib/translations'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
import { Icon, XMark } from 'svelte-hero-icons'
|
||||
|
||||
export let postId: number
|
||||
export let parentId: number | undefined = undefined
|
||||
@@ -90,20 +91,21 @@
|
||||
<div class="flex-1" />
|
||||
{#if actions}
|
||||
<Button
|
||||
size="custom"
|
||||
title={$t('common.cancel')}
|
||||
on:click={() => dispatch('cancel', true)}
|
||||
color="tertiary"
|
||||
size="lg"
|
||||
class=" w-28"
|
||||
class="w-8 h-8"
|
||||
rounding="xl"
|
||||
>
|
||||
{$t('common.cancel')}
|
||||
<Icon src={XMark} size="16" micro />
|
||||
</Button>
|
||||
<Button
|
||||
on:click={submit}
|
||||
color="primary"
|
||||
size="lg"
|
||||
class=" w-28"
|
||||
{loading}
|
||||
disabled={locked || loading || banned}
|
||||
size="lg"
|
||||
>
|
||||
{$t('form.submit')}
|
||||
</Button>
|
||||
|
||||
@@ -12,51 +12,61 @@
|
||||
export let comment: CommentView
|
||||
export let view = $userSettings.view
|
||||
export let community = false
|
||||
|
||||
export let meta: boolean = true
|
||||
</script>
|
||||
|
||||
<Material
|
||||
class="flex flex-col flex-1 {view != 'card'
|
||||
? '!bg-transparent !border-0 rounded-none'
|
||||
: 'p-5'} {view == 'list' ? 'py-5' : view == 'compact' ? 'py-4' : 'py-5'}"
|
||||
: 'p-5'} {view == 'list'
|
||||
? 'py-5'
|
||||
: view == 'compact'
|
||||
? 'py-4'
|
||||
: 'py-5'} {$$props.class}"
|
||||
color="distinct"
|
||||
padding="none"
|
||||
>
|
||||
<div class="flex flex-row justify-between items-center gap-2">
|
||||
<div class="flex flex-col gap-2">
|
||||
<PostMeta
|
||||
badges={{
|
||||
nsfw: comment.post.nsfw,
|
||||
removed: comment.post.removed,
|
||||
admin: false,
|
||||
moderator: false,
|
||||
saved: false,
|
||||
deleted: comment.post.deleted,
|
||||
featured:
|
||||
comment.post.featured_community || comment.post.featured_local,
|
||||
locked: comment.post.locked,
|
||||
}}
|
||||
published={publishedToDate(comment.comment.published)}
|
||||
community={community ? comment.community : undefined}
|
||||
title={comment.post.name}
|
||||
id={comment.post.id}
|
||||
titleClass="text-sm"
|
||||
/>
|
||||
{#if meta}
|
||||
<div class="flex flex-row justify-between items-center gap-2">
|
||||
<div class="flex flex-col gap-2">
|
||||
<PostMeta
|
||||
badges={{
|
||||
nsfw: comment.post.nsfw,
|
||||
removed: comment.post.removed,
|
||||
admin: false,
|
||||
moderator: false,
|
||||
saved: false,
|
||||
deleted: comment.post.deleted,
|
||||
featured:
|
||||
comment.post.featured_community || comment.post.featured_local,
|
||||
locked: comment.post.locked,
|
||||
}}
|
||||
published={publishedToDate(comment.comment.published)}
|
||||
community={community ? comment.community : undefined}
|
||||
title={comment.post.name}
|
||||
id={comment.post.id}
|
||||
titleClass="text-sm"
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
color="primary"
|
||||
href="/post/{comment.post.id}?thread={comment.comment.path}#{comment
|
||||
.comment.id}"
|
||||
class="self-start"
|
||||
>
|
||||
{$t('common.jump')}
|
||||
<Icon src={ArrowUturnUp} size="16" micro />
|
||||
</Button>
|
||||
</div>
|
||||
<Button
|
||||
color="primary"
|
||||
href="/post/{comment.post.id}?thread={comment.comment.path}#{comment
|
||||
.comment.id}"
|
||||
class="self-start"
|
||||
>
|
||||
{$t('common.jump')}
|
||||
<Icon src={ArrowUturnUp} size="16" micro />
|
||||
</Button>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="list-none">
|
||||
<Comment
|
||||
postId={comment.post.id}
|
||||
node={{ children: [], comment_view: comment, depth: 1 }}
|
||||
node={{ children: [], comment_view: comment, depth: 1, ui: {} }}
|
||||
replying={false}
|
||||
{meta}
|
||||
{...$$restProps}
|
||||
/>
|
||||
</div>
|
||||
</Material>
|
||||
Reference in new issue
Block a user