design: redesign inbox (again)
This commit is contained in:
1 parent
0d378ec248
commit
0d0681b687
13 files changed
+175
-95
No files matched your search
@@ -31,7 +31,9 @@
|
|||||||
export let node: CommentNodeI
|
export let node: CommentNodeI
|
||||||
export let postId: number
|
export let postId: number
|
||||||
export let op: boolean = false
|
export let op: boolean = false
|
||||||
|
|
||||||
export let actions: boolean = true
|
export let actions: boolean = true
|
||||||
|
export let meta: boolean = true
|
||||||
|
|
||||||
export let open = true
|
export let open = true
|
||||||
export let replying = false
|
export let replying = false
|
||||||
@@ -109,6 +111,7 @@
|
|||||||
: ''} {highlight} {$$props.class}"
|
: ''} {highlight} {$$props.class}"
|
||||||
id={node.comment_view.comment.id.toString()}
|
id={node.comment_view.comment.id.toString()}
|
||||||
>
|
>
|
||||||
|
{#if meta}
|
||||||
<button
|
<button
|
||||||
on:click={() => (open = !open)}
|
on:click={() => (open = !open)}
|
||||||
class="flex flex-row cursor-pointer gap-2 items-center group text-[13px] flex-wrap w-full
|
class="flex flex-row cursor-pointer gap-2 items-center group text-[13px] flex-wrap w-full
|
||||||
@@ -184,6 +187,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
{/if}
|
||||||
{#if open}
|
{#if open}
|
||||||
<div transition:slide={{ duration: 400, easing: expoOut }}>
|
<div transition:slide={{ duration: 400, easing: expoOut }}>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
import { errorMessage } from '$lib/lemmy/error'
|
||||||
|
import { Icon, XMark } from 'svelte-hero-icons'
|
||||||
|
|
||||||
export let postId: number
|
export let postId: number
|
||||||
export let parentId: number | undefined = undefined
|
export let parentId: number | undefined = undefined
|
||||||
@@ -90,20 +91,21 @@
|
|||||||
<div class="flex-1" />
|
<div class="flex-1" />
|
||||||
{#if actions}
|
{#if actions}
|
||||||
<Button
|
<Button
|
||||||
|
size="custom"
|
||||||
|
title={$t('common.cancel')}
|
||||||
on:click={() => dispatch('cancel', true)}
|
on:click={() => dispatch('cancel', true)}
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
size="lg"
|
class="w-8 h-8"
|
||||||
class=" w-28"
|
rounding="xl"
|
||||||
>
|
>
|
||||||
{$t('common.cancel')}
|
<Icon src={XMark} size="16" micro />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={submit}
|
on:click={submit}
|
||||||
color="primary"
|
color="primary"
|
||||||
size="lg"
|
|
||||||
class=" w-28"
|
|
||||||
{loading}
|
{loading}
|
||||||
disabled={locked || loading || banned}
|
disabled={locked || loading || banned}
|
||||||
|
size="lg"
|
||||||
>
|
>
|
||||||
{$t('form.submit')}
|
{$t('form.submit')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -12,15 +12,22 @@
|
|||||||
export let comment: CommentView
|
export let comment: CommentView
|
||||||
export let view = $userSettings.view
|
export let view = $userSettings.view
|
||||||
export let community = false
|
export let community = false
|
||||||
|
|
||||||
|
export let meta: boolean = true
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Material
|
<Material
|
||||||
class="flex flex-col flex-1 {view != 'card'
|
class="flex flex-col flex-1 {view != 'card'
|
||||||
? '!bg-transparent !border-0 rounded-none'
|
? '!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"
|
color="distinct"
|
||||||
padding="none"
|
padding="none"
|
||||||
>
|
>
|
||||||
|
{#if meta}
|
||||||
<div class="flex flex-row justify-between items-center gap-2">
|
<div class="flex flex-row justify-between items-center gap-2">
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<PostMeta
|
<PostMeta
|
||||||
@@ -52,11 +59,14 @@
|
|||||||
<Icon src={ArrowUturnUp} size="16" micro />
|
<Icon src={ArrowUturnUp} size="16" micro />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
<div class="list-none">
|
<div class="list-none">
|
||||||
<Comment
|
<Comment
|
||||||
postId={comment.post.id}
|
postId={comment.post.id}
|
||||||
node={{ children: [], comment_view: comment, depth: 1 }}
|
node={{ children: [], comment_view: comment, depth: 1, ui: {} }}
|
||||||
replying={false}
|
replying={false}
|
||||||
|
{meta}
|
||||||
|
{...$$restProps}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Material>
|
</Material>
|
||||||
@@ -5,9 +5,11 @@
|
|||||||
import type { PrivateMessageView } from 'lemmy-js-client'
|
import type { PrivateMessageView } from 'lemmy-js-client'
|
||||||
|
|
||||||
export let message: PrivateMessageView
|
export let message: PrivateMessageView
|
||||||
|
export let meta: boolean = true
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col gap-2" style={$$props.style ?? ''}>
|
<div class="flex flex-col gap-2 text-sm" style={$$props.style ?? ''}>
|
||||||
|
{#if meta}
|
||||||
<div class="flex flex-row gap-2 items-center flex-wrap">
|
<div class="flex flex-row gap-2 items-center flex-wrap">
|
||||||
<span class="font-medium text-xs">From</span>
|
<span class="font-medium text-xs">From</span>
|
||||||
<UserLink
|
<UserLink
|
||||||
@@ -26,5 +28,6 @@
|
|||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
<Markdown source={message.private_message.content} />
|
<Markdown source={message.private_message.content} />
|
||||||
</div>
|
</div>
|
||||||
@@ -381,7 +381,8 @@
|
|||||||
data.url = url.toString()
|
data.url = url.toString()
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}}
|
}}
|
||||||
size="lg"
|
size="sm"
|
||||||
|
rounding="pill"
|
||||||
>
|
>
|
||||||
<Icon src={Link} size="16" micro />
|
<Icon src={Link} size="16" micro />
|
||||||
{$t('form.post.addUrl')}
|
{$t('form.post.addUrl')}
|
||||||
@@ -391,14 +392,15 @@
|
|||||||
data.url = ''
|
data.url = ''
|
||||||
uploadingImage = true
|
uploadingImage = true
|
||||||
}}
|
}}
|
||||||
size="lg"
|
size="sm"
|
||||||
|
rounding="pill"
|
||||||
>
|
>
|
||||||
<Icon src={Photo} size="16" micro />
|
<Icon src={Photo} size="16" micro />
|
||||||
{$t('form.post.uploadImage')}
|
{$t('form.post.uploadImage')}
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
{#if data.language_id === undefined}
|
{#if data.language_id === undefined}
|
||||||
<Button size="lg" on:click={() => (data.language_id = 0)}>
|
<Button size="sm" rounding="pill" on:click={() => (data.language_id = 0)}>
|
||||||
<Icon src={Language} size="16" micro />
|
<Icon src={Language} size="16" micro />
|
||||||
{$t('form.post.setLanguage')}
|
{$t('form.post.setLanguage')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import { Disclosure } from 'mono-svelte'
|
import { Disclosure } from 'mono-svelte'
|
||||||
import { Minus, Plus, Icon } from 'svelte-hero-icons'
|
import { Minus, Plus, Icon } from 'svelte-hero-icons'
|
||||||
export let open: boolean = false
|
export let open: boolean = false
|
||||||
|
export let icon: boolean = true
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Disclosure
|
<Disclosure
|
||||||
@@ -16,6 +17,7 @@
|
|||||||
<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" />
|
||||||
</div>
|
</div>
|
||||||
|
{#if icon}
|
||||||
<Icon
|
<Icon
|
||||||
src={open ? Minus : Plus}
|
src={open ? Minus : Plus}
|
||||||
size="16"
|
size="16"
|
||||||
@@ -24,11 +26,13 @@
|
|||||||
? ''
|
? ''
|
||||||
: 'rotate-90'} transition-transform duration-300 ease-out"
|
: 'rotate-90'} transition-transform duration-300 ease-out"
|
||||||
/>
|
/>
|
||||||
|
{/if}
|
||||||
<div
|
<div
|
||||||
class="inset-0 -z-10 opacity-0 absolute bg-slate-100 dark:bg-zinc-900 rounded-full
|
class="inset-0 -z-10 opacity-0 absolute bg-slate-100 dark:bg-zinc-900 rounded-full
|
||||||
group-hover:opacity-100 group-hover:-inset-1 group-hover:-inset-x-2 transition-all"
|
group-hover:opacity-100 group-hover:-inset-1 group-hover:-inset-x-2 transition-all"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<slot name="extended" slot="extended" />
|
||||||
<slot name="content">
|
<slot name="content">
|
||||||
<div class="pt-2 text-slate-900 dark:text-zinc-100">
|
<div class="pt-2 text-slate-900 dark:text-zinc-100">
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
import CommandsWrapper from './commands/CommandsWrapper.svelte'
|
import CommandsWrapper from './commands/CommandsWrapper.svelte'
|
||||||
import { optimizeImageURL } from '$lib/components/lemmy/post/helpers'
|
import { optimizeImageURL } from '$lib/components/lemmy/post/helpers'
|
||||||
import { userSettings } from '$lib/settings'
|
import { userSettings } from '$lib/settings'
|
||||||
|
import { dockProps } from '../layout/Shell.svelte'
|
||||||
|
|
||||||
let promptOpen: boolean = false
|
let promptOpen: boolean = false
|
||||||
</script>
|
</script>
|
||||||
@@ -153,7 +154,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
</Menu>
|
</Menu>
|
||||||
{#if $profile?.user?.local_user_view.person.avatar}
|
{#if $profile?.user?.local_user_view.person.avatar && !$dockProps.noGap}
|
||||||
<div
|
<div
|
||||||
class="absolute right-0 -z-10 h-full
|
class="absolute right-0 -z-10 h-full
|
||||||
overflow-hidden w-full ml-auto"
|
overflow-hidden w-full ml-auto"
|
||||||
|
|||||||
@@ -277,6 +277,11 @@
|
|||||||
"empty": {
|
"empty": {
|
||||||
"title": "No new notifications",
|
"title": "No new notifications",
|
||||||
"description": "Messages, replies, and mentions will appear here."
|
"description": "Messages, replies, and mentions will appear here."
|
||||||
|
},
|
||||||
|
"item": {
|
||||||
|
"reply": "{{user}} replied to you in {{post}}",
|
||||||
|
"mention": "{{user}} mentioned you in {{post}}",
|
||||||
|
"message": "{{user}} messaged {{recipient}}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"moderation": {
|
"moderation": {
|
||||||
|
|||||||
@@ -14,11 +14,11 @@
|
|||||||
dark:bg-primary-100 dark:text-black hover:brightness-125 dark:hover:brightness-90 active:brightness-90
|
dark:bg-primary-100 dark:text-black hover:brightness-125 dark:hover:brightness-90 active:brightness-90
|
||||||
active:dark:brightness-75`,
|
active:dark:brightness-75`,
|
||||||
|
|
||||||
secondary: `border border-slate-200 border-b-slate-300 dark:border-zinc-800 dark:border-t-zinc-700/70 bg-white dark:bg-zinc-900
|
secondary: `border border-slate-200 border-b-slate-300 dark:border-zinc-800 bg-white dark:bg-zinc-900
|
||||||
hover:bg-slate-100 hover:dark:bg-zinc-800 hover:dark:border-zinc-700 hover:dark:border-zinc-700 active:dark:bg-zinc-900 active:bg-slate-200`,
|
hover:bg-slate-100 hover:dark:bg-zinc-800 hover:dark:border-zinc-700 hover:dark:border-zinc-700 active:dark:bg-zinc-900 active:bg-slate-200`,
|
||||||
|
|
||||||
tertiary:
|
tertiary:
|
||||||
'border border-transparent bg-transparent hover:bg-slate-100 hover:dark:bg-zinc-800 dark:text-zinc-200',
|
'border border-transparent bg-transparent hover:bg-slate-100 hover:dark:bg-zinc-700/30 dark:text-zinc-200',
|
||||||
|
|
||||||
danger:
|
danger:
|
||||||
'border border-red-500 bg-red-500 hover:text-red-500 hover:bg-transparent text-white',
|
'border border-red-500 bg-red-500 hover:text-red-500 hover:bg-transparent text-white',
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
export type ButtonSize = keyof typeof buttonSize
|
export type ButtonSize = keyof typeof buttonSize
|
||||||
|
|
||||||
export const buttonSize = {
|
export const buttonSize = {
|
||||||
sm: 'px-2 py-1',
|
sm: 'px-3 py-1.5 text-xs',
|
||||||
md: 'px-3 py-1.5',
|
md: 'px-3 py-1.5',
|
||||||
lg: 'px-4 py-2',
|
lg: 'px-4 py-2',
|
||||||
xl: 'px-6 py-3',
|
xl: 'px-6 py-3',
|
||||||
@@ -147,7 +147,7 @@
|
|||||||
{buttonSize[size]}
|
{buttonSize[size]}
|
||||||
{buttonRounding[rounding][roundingSide]}
|
{buttonRounding[rounding][roundingSide]}
|
||||||
{buttonShadow[shadow]}
|
{buttonShadow[shadow]}
|
||||||
text-sm transition-all font-medium cursor-pointer duration-100
|
text-sm transition-all font-medium cursor-pointer duration-75
|
||||||
disabled:opacity-50 disabled:pointer-events-none
|
disabled:opacity-50 disabled:pointer-events-none
|
||||||
{alignment == 'center'
|
{alignment == 'center'
|
||||||
? 'origin-center'
|
? 'origin-center'
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
<button on:click={() => (open = !open)} class="w-full">
|
<button on:click={() => (open = !open)} class="w-full">
|
||||||
<slot name="summary" {open} />
|
<slot name="summary" {open} />
|
||||||
</button>
|
</button>
|
||||||
|
<slot name="extended" />
|
||||||
{#if open}
|
{#if open}
|
||||||
<div transition:slide={{ axis: 'y', easing: expoOut, duration: 300 }}>
|
<div transition:slide={{ axis: 'y', easing: expoOut, duration: 300 }}>
|
||||||
<slot {open} />
|
<slot {open} />
|
||||||
|
|||||||
@@ -149,7 +149,7 @@
|
|||||||
{#each sliced as community, index (community.community.id)}
|
{#each sliced as community, index (community.community.id)}
|
||||||
<div
|
<div
|
||||||
class="px-6 hover:bg-slate-50 hover:dark:bg-zinc-900 transition-colors @container
|
class="px-6 hover:bg-slate-50 hover:dark:bg-zinc-900 transition-colors @container
|
||||||
border-b border-slate-100 dark:border-zinc-800"
|
border-b border-slate-100 dark:border-zinc-900"
|
||||||
in:fly|global={{
|
in:fly|global={{
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
easing: expoOut,
|
easing: expoOut,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
||||||
import { contentPadding } from '$lib/components/ui/layout/Shell.svelte'
|
import { contentPadding } from '$lib/components/ui/layout/Shell.svelte'
|
||||||
|
import { expoOut } from 'svelte/easing'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
|
|
||||||
@@ -97,27 +98,24 @@
|
|||||||
{$t('routes.inbox.markAsRead')}
|
{$t('routes.inbox.markAsRead')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</Header>
|
|
||||||
</div>
|
|
||||||
<div class="mt-4" />
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="mt-4 mb-0 sticky z-30 mx-auto max-w-full flex gap-2 md:flex-row flex-col
|
class="mt-4 mb-0 sticky z-30 mx-auto max-w-full flex gap-2 md:flex-row flex-col
|
||||||
items-center px-2"
|
items-center px-2 w-max"
|
||||||
style="top: max(1.5rem, {$contentPadding.top}px);"
|
style="top: max(1.5rem, {$contentPadding.top}px);"
|
||||||
|
slot="extended"
|
||||||
>
|
>
|
||||||
<Tabs
|
<Tabs
|
||||||
routes={[
|
routes={[
|
||||||
{
|
{
|
||||||
href: '?type=All',
|
href: '?type=all',
|
||||||
name: $t('filter.location.all'),
|
name: $t('filter.location.all'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: '?type=Replies',
|
href: '?type=replies',
|
||||||
name: $t('filter.inbox.replies'),
|
name: $t('filter.inbox.replies'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: '?type=Mentions',
|
href: '?type=mentions',
|
||||||
name: $t('filter.inbox.mentions'),
|
name: $t('filter.inbox.mentions'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -157,7 +155,13 @@
|
|||||||
defaultRoute="?unreadOnly=true"
|
defaultRoute="?unreadOnly=true"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-4 list-none flex-1 h-full mt-4">
|
</Header>
|
||||||
|
</div>
|
||||||
|
<div class="mt-4" />
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="flex flex-col list-none flex-1 h-full mt-4 divide-y divide-slate-200 dark:divide-zinc-900 *:py-4"
|
||||||
|
>
|
||||||
{#if !data.data || (data.data?.length ?? 0) == 0}
|
{#if !data.data || (data.data?.length ?? 0) == 0}
|
||||||
<Placeholder
|
<Placeholder
|
||||||
icon={Inbox}
|
icon={Inbox}
|
||||||
@@ -165,9 +169,19 @@
|
|||||||
description={$t('routes.inbox.empty.description')}
|
description={$t('routes.inbox.empty.description')}
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
{#each data.data as item}
|
{#each data.data as item, index (item.id)}
|
||||||
<div in:fly={{ duration: 500, y: -6, opacity: 0 }}>
|
<div
|
||||||
<InboxItem {item} />
|
class="-mx-4 sm:-mx-6 px-4 sm:px-6
|
||||||
|
{item.read ? '' : 'bg-yellow-50/50 dark:bg-blue-500/5'}"
|
||||||
|
in:fly|global={{
|
||||||
|
duration: 1000,
|
||||||
|
y: 16,
|
||||||
|
opacity: 0,
|
||||||
|
easing: expoOut,
|
||||||
|
delay: index * 50,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<InboxItem bind:item />
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
Check,
|
Check,
|
||||||
Envelope,
|
Envelope,
|
||||||
Icon,
|
Icon,
|
||||||
|
Eye,
|
||||||
|
EyeSlash,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import { Material } from 'mono-svelte'
|
import { Material } from 'mono-svelte'
|
||||||
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
||||||
@@ -22,6 +24,9 @@
|
|||||||
import PrivateMessage from '$lib/components/lemmy/inbox/PrivateMessage.svelte'
|
import PrivateMessage from '$lib/components/lemmy/inbox/PrivateMessage.svelte'
|
||||||
import PrivateMessageModal from '$lib/components/lemmy/modal/PrivateMessageModal.svelte'
|
import PrivateMessageModal from '$lib/components/lemmy/modal/PrivateMessageModal.svelte'
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
|
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||||
|
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
||||||
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
|
|
||||||
export let item: InboxItem
|
export let item: InboxItem
|
||||||
|
|
||||||
@@ -68,91 +73,120 @@
|
|||||||
<PrivateMessageModal bind:open={replying} user={item.item.creator} />
|
<PrivateMessageModal bind:open={replying} user={item.item.creator} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<Material
|
<Expandable open icon={false}>
|
||||||
class="flex flex-col max-w-full gap-4"
|
<div class="flex flex-row gap-2 items-center w-full" slot="title">
|
||||||
color="transparent"
|
<Avatar
|
||||||
rounding="xl"
|
url={item.creator.avatar}
|
||||||
>
|
circle={false}
|
||||||
<div class="meta w-full">
|
width={28}
|
||||||
<div
|
alt={item.creator.name}
|
||||||
class="rounded-full p-1 h-10 w-10 border border-slate-200 dark:border-zinc-800 grid place-items-center"
|
/>
|
||||||
style="grid-area: a;"
|
<!-- <div class="rounded-full p-1 border border-slate-200 dark:border-zinc-800">
|
||||||
>
|
|
||||||
<Icon
|
<Icon
|
||||||
src={item.type == 'private_message'
|
src={item.type == 'comment_reply'
|
||||||
? Envelope
|
|
||||||
: item.type == 'comment_reply'
|
|
||||||
? ChatBubbleOvalLeft
|
? ChatBubbleOvalLeft
|
||||||
|
: item.type == 'private_message'
|
||||||
|
? Envelope
|
||||||
|
: item.type == 'person_mention'
|
||||||
|
? AtSymbol
|
||||||
: AtSymbol}
|
: AtSymbol}
|
||||||
size="24"
|
size="20"
|
||||||
|
mini
|
||||||
|
class="text-slate-600 dark:text-zinc-400"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div> -->
|
||||||
<RelativeDate
|
<div class="flex flex-col">
|
||||||
class="text-xs text-slate-600 dark:text-zinc-400"
|
<div class="text-sm font-normal">
|
||||||
date={publishedToDate(item.published)}
|
{#if item.type == 'comment_reply'}
|
||||||
style="grid-area: b;"
|
{@html $t('routes.inbox.item.reply', {
|
||||||
/>
|
// @ts-ignore
|
||||||
{#if item.type != 'private_message'}
|
user: `<span class="font-medium">${item.creator.name}</span>`,
|
||||||
<PostMeta title={item.item.post.name} id={item.item.post.id} />
|
post: `<span class="font-medium">${item.item.post.name}</span>`,
|
||||||
{:else}
|
})}
|
||||||
<PrivateMessage message={item.item} style="grid-area: title;" />
|
{:else if item.type == 'person_mention'}
|
||||||
|
{@html $t('routes.inbox.item.mention', {
|
||||||
|
// @ts-ignore
|
||||||
|
user: `<span class="font-medium">${item.creator.name}</span>`,
|
||||||
|
post: `<span class="font-medium">${item.item.post.name}</span>`,
|
||||||
|
})}
|
||||||
|
{:else if item.type == 'private_message'}
|
||||||
|
{@html $t('routes.inbox.item.message', {
|
||||||
|
// @ts-ignore
|
||||||
|
user: `<span class="font-medium">${item.item.creator.name}</span>`,
|
||||||
|
recipient: `<span class="font-medium">${item.item.recipient.name}</span>`,
|
||||||
|
})}
|
||||||
{/if}
|
{/if}
|
||||||
<div class="flex flex-row gap-2 h-8" style="grid-area: actions;">
|
</div>
|
||||||
{#if !(item.type == 'private_message' && item.item.creator.id == $profile?.user?.local_user_view.person.id)}
|
<div class="text-xs text-slate-600 dark:text-zinc-400">
|
||||||
|
<RelativeDate date={publishedToDate(item.published)} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex-1" />
|
||||||
|
<div class="flex gap-2 max-md:hidden flex-shrink-0">
|
||||||
<Button
|
<Button
|
||||||
class={item.read ? '!text-green-500' : ''}
|
color={item.read ? 'secondary' : 'primary'}
|
||||||
size="square-md"
|
|
||||||
{loading}
|
{loading}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
on:click={() => markAsRead(!item.read)}
|
on:click={(e) => {
|
||||||
title={$t('post.actions.more.markRead')}
|
e.stopPropagation()
|
||||||
|
markAsRead(!item.read)
|
||||||
|
}}
|
||||||
|
size="sm"
|
||||||
|
rounding="pill"
|
||||||
|
class="flex-shrink-0"
|
||||||
>
|
>
|
||||||
<Icon slot="prefix" src={Check} micro size="16" />
|
<Icon src={item.read ? EyeSlash : Eye} size="16" micro slot="prefix" />
|
||||||
|
{item.read
|
||||||
|
? $t('post.actions.more.markUnread')
|
||||||
|
: $t('post.actions.more.markRead')}
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{#if item.type == 'comment_reply' || item.type == 'person_mention'}
|
||||||
|
|
||||||
{#if item.type == 'private_message'}
|
|
||||||
{#if item.item.creator.id != $profile?.user?.local_user_view.person.id}
|
|
||||||
<Button size="square-md" on:click={() => (replying = !replying)}>
|
|
||||||
<Icon src={ArrowUturnLeft} size="16" micro />
|
|
||||||
</Button>
|
|
||||||
{/if}
|
|
||||||
{:else}
|
|
||||||
<Button
|
<Button
|
||||||
title={$t('common.jump')}
|
|
||||||
href="/comment/{item.item.comment.id}"
|
href="/comment/{item.item.comment.id}"
|
||||||
size="square-md"
|
size="sm"
|
||||||
|
rounding="pill"
|
||||||
|
class="flex-shrink-0"
|
||||||
>
|
>
|
||||||
<Icon src={ArrowUturnUp} micro size="16" />
|
{$t('common.jump')}
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col">
|
<div slot="extended" class="flex gap-2 w-full md:hidden">
|
||||||
{#if item.type != 'private_message' && $profile?.user && item.item.post.creator_id != $profile.user.local_user_view.person.id}
|
<Button
|
||||||
<div class="flex flex-row text-xs items-center gap-2">
|
color={item.read ? 'secondary' : 'primary'}
|
||||||
<div
|
{loading}
|
||||||
class="border-t w-8 rounded-tl h-2 border-l ml-2 border-zinc-700"
|
disabled={loading}
|
||||||
/>
|
on:click={(e) => {
|
||||||
<div>
|
e.stopPropagation()
|
||||||
<UserLink
|
markAsRead(!item.read)
|
||||||
avatar
|
}}
|
||||||
avatarSize={16}
|
size="sm"
|
||||||
user={$profile.user.local_user_view.person}
|
rounding="pill"
|
||||||
/>
|
>
|
||||||
</div>
|
<Icon src={item.read ? EyeSlash : Eye} size="16" micro slot="prefix" />
|
||||||
</div>
|
{$t('routes.inbox.item.markRead')}
|
||||||
{/if}
|
</Button>
|
||||||
{#if item.type != 'private_message'}
|
{#if item.type == 'comment_reply' || item.type == 'person_mention'}
|
||||||
<Comment
|
<Button href="/comment/{item.item.comment.id}" size="sm" rounding="pill">
|
||||||
postId={item.item.post.id}
|
{$t('common.jump')}
|
||||||
node={{ children: [], comment_view: item.item, depth: 1 }}
|
</Button>
|
||||||
replying={false}
|
|
||||||
class="!p-0"
|
|
||||||
/>
|
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</Material>
|
<svelte:fragment slot="content">
|
||||||
|
{#if item.type == 'comment_reply' || item.type == 'person_mention'}
|
||||||
|
<CommentItem
|
||||||
|
comment={item.item}
|
||||||
|
community={false}
|
||||||
|
view="cozy"
|
||||||
|
meta={false}
|
||||||
|
class="pt-0 pb-0"
|
||||||
|
/>
|
||||||
|
{:else}
|
||||||
|
<PrivateMessage message={item.item} meta={false} />
|
||||||
|
{/if}
|
||||||
|
</svelte:fragment>
|
||||||
|
</Expandable>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.meta {
|
.meta {
|
||||||
|
|||||||
Reference in new issue
Block a user