design: improve comments

This commit is contained in:
Xylight committed 2024-06-12 14:00:41 -07:00
1 parent eef339bf4c
commit 3e2ccbd220
6 files changed
+24 -18

No files matched your search

@@ -67,11 +67,13 @@
{:else if type == 'instance'} {:else if type == 'instance'}
<Search <Search
search={async (q) => { search={async (q) => {
const results = await instances || {} const results = (await instances) || {}
return q ? (results.federated_instances?.linked || []).filter( return q
(i) => i.software === 'lemmy' && i.domain.includes(q) ? (results.federated_instances?.linked || []).filter(
) : [] (i) => i.software === 'lemmy' && i.domain.includes(q)
)
: []
}} }}
extractName={(i) => `${i.domain}`} extractName={(i) => `${i.domain}`}
on:select on:select
@@ -23,6 +23,8 @@
import { page } from '$app/stores' import { page } from '$app/stores'
import { onMount } from 'svelte' import { onMount } from 'svelte'
import { t } from '$lib/translations' import { t } from '$lib/translations'
import { slide } from 'svelte/transition'
import { expoOut } from 'svelte/easing'
export let node: CommentNodeI export let node: CommentNodeI
export let postId: number export let postId: number
@@ -176,6 +178,7 @@
{#if replying} {#if replying}
<div <div
class="max-w-full my-2 border-l border-slate-200 dark:border-zinc-800 pl-4" class="max-w-full my-2 border-l border-slate-200 dark:border-zinc-800 pl-4"
transition:slide={{ axis: 'y', duration: 400, easing: expoOut }}
> >
<h1 class="font-bold text-sm mb-2">{$t('comment.reply')}</h1> <h1 class="font-bold text-sm mb-2">{$t('comment.reply')}</h1>
<CommentForm <CommentForm
@@ -142,7 +142,10 @@
}} }}
> >
<Icon src={ChevronDoubleDown} mini size="16" slot="prefix" /> <Icon src={ChevronDoubleDown} mini size="16" slot="prefix" />
{node.comment_view.counts.child_count} more {$t('comment.more', {
// @ts-ignore
comments: node.comment_view.counts.child_count,
})}
</Button> </Button>
</svelte:element> </svelte:element>
{/if} {/if}
@@ -183,7 +183,8 @@ overflow-hidden transition-colors"
{#if tools} {#if tools}
<!--Toolbar--> <!--Toolbar-->
<div <div
class="[&>*]:flex-shrink-0 flex flex-row overflow-auto p-1.5 gap-1.5 {$$props.disabled class="[&>*]:flex-shrink-0 flex flex-row overflow-auto p-1.5 gap-1.5 border-b
border-slate-200 dark:border-zinc-900 {$$props.disabled
? 'opacity-60 pointer-events-none' ? 'opacity-60 pointer-events-none'
: ''}" : ''}"
> >
+2 -1
View File
@@ -413,7 +413,8 @@
"label": "Actions", "label": "Actions",
"link": "Copy Link" "link": "Copy Link"
}, },
"locked": "This post is locked." "locked": "This post is locked.",
"more": "{{comments:number}} more"
}, },
"moderation": { "moderation": {
"report": "Report", "report": "Report",
+7 -11
View File
@@ -29,29 +29,25 @@ export const fullCommunityName = (name: string, actorId: string) =>
`${name}@${new URL(actorId).hostname}` `${name}@${new URL(actorId).hostname}`
export const placeholders = { export const placeholders = {
url: ['https://notas.cam', 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'], url: ['https://www.youtube.com/watch?v=dQw4w9WgXcQ'],
post: [ post: [
'Is starting nuclear warfare illegal?', 'Is starting nuclear warfare illegal?',
'A cool photo I took before the destruction of mankind!', "AITA for making somebody's day?",
'AITA for ending all contention and causing world peace?',
'BREAKING NEWS: Police break into gun shop, find weapons', 'BREAKING NEWS: Police break into gun shop, find weapons',
'How do I make sure my pet rock stays alive?', 'How do I make sure my pet rock stays alive?',
'My cat just invented a time machine, what do I do?', 'My cat just invented a time machine, what do I do?',
'Unpopular opinion: world peace and global happiness would be beneficial to humanity', 'Unpopular opinion: world peace would be beneficial to humanity',
'LPT: The smaller weights are easier to lift than the bigger weights in a gym', 'LPT: The smaller weights are easier to lift than the bigger weights in a gym',
'javascript bad',
'ELI5: What is 4 + 8?', 'ELI5: What is 4 + 8?',
], ],
comment: [ comment: [
'aint no way', 'what?',
'new response just dropped', 'new response just dropped',
'<insert funny joke here>', "i did not read this post at all and i'm about to give my opinion on it.",
'say, why did we name restaurant staff after computers, anyway?',
`this.\nedit: thanks for 1 upvote😃😃😃!`,
'Officer, I drop kicked that child in self defense! You gotta believe me man.',
'this comment placeholder is very important dont forget', 'this comment placeholder is very important dont forget',
'As Abraham Lincoln once said, "don\'t believe everything you see on the internet."', 'huh. i did not understand any of that.',
'existential crisis in progress', 'existential crisis in progress',
'hello user i am a sentient placeholder. please dont type anything or i disappear forever. thanks',
], ],
get: (type: 'url' | 'post' | 'comment') => { get: (type: 'url' | 'post' | 'comment') => {
return get(userSettings)?.randomPlaceholders return get(userSettings)?.randomPlaceholders