misc: tweak comment actions

This commit is contained in:
Xylight committed 2024-08-15 17:34:02 -07:00
1 parent c4dfa7daa8
commit d950796ccd
3 files changed
+18 -11

No files matched your search

@@ -3,6 +3,7 @@
ArrowUp,
Bookmark,
Icon,
Microphone,
Minus,
Pencil,
Plus,
@@ -78,7 +79,7 @@
{#if editing}
<Modal bind:open={editing}>
<span slot="title">Edit comment</span>
<span slot="title">{$t('form.edit')}</span>
<form on:submit|preventDefault={save} class="contents">
<CommentForm
postId={node.comment_view.comment.id}
@@ -95,7 +96,7 @@
disabled={editingLoad}
class="w-full"
>
Save
{$t('common.save')}
</Button>
</form>
</Modal>
@@ -128,7 +129,7 @@
</svelte:fragment>
</UserLink>
{#if op}
<span class="text-sky-500">OP</span>
<Icon mini size="16" src={Microphone} class="text-sky-600" />
{/if}
</span>
<RelativeDate
@@ -160,7 +161,7 @@
</span>
</button>
{#if open}
<div transition:slide={{ duration: 500, easing: expoOut }}>
<div transition:slide={{ duration: 400, easing: expoOut }}>
<div
class="flex flex-col whitespace-pre-wrap
max-w-full gap-1 mt-1 relative"
@@ -5,6 +5,7 @@
ArrowUturnLeft,
Bookmark,
BookmarkSlash,
ChatBubbleOvalLeft,
EllipsisHorizontal,
Flag,
Icon,
@@ -53,11 +54,12 @@
<Button
size="sm"
color="tertiary"
class="text-slate-600 dark:text-zinc-400"
rounding="pill"
class="text-slate-700 dark:text-zinc-300"
on:click={() => (replying = !replying)}
disabled={comment.post.locked || disabled}
>
<Icon src={ArrowUturnLeft} width={14} height={14} mini />
<Icon src={ChatBubbleOvalLeft} size="14" micro />
<span class="text-xs">{$t('comment.reply')}</span>
</Button>
{#if $profile?.user && (amMod($profile?.user, comment.community) || isAdmin($profile.user))}
@@ -66,9 +68,11 @@
<Menu placement="bottom">
<Button
slot="target"
class="!p-1 text-slate-600 dark:text-zinc-400"
title={$t('comment.actions.label')}
color="tertiary"
rounding="pill"
size="square-sm"
class="text-slate-700 dark:text-zinc-300"
>
<Icon
src={EllipsisHorizontal}
@@ -38,10 +38,12 @@
}
</script>
<div class="rounded-lg h-full flex items-center [&>*]:p-2 overflow-hidden">
<div
class="h-full flex items-center overflow-hidden {buttonColor.ghost} rounded-full hover:bg-transparent"
>
<button
on:click={() => castVote(vote == 1 ? 0 : 1)}
class="flex items-center gap-0.5 {buttonColor.tertiary} transition-colors border-0 !pl-2 !pr-3
class="flex items-center gap-0.5 transition-colors px-1.5 h-full {buttonColor.tertiary}
{vote == 1 ? shouldShowVoteColor(vote, 'upvotes') : ''}"
>
<Icon src={ChevronUp} size="18" mini />
@@ -58,11 +60,11 @@
</span>
</button>
<div
class="border-l h-6 w-0 !p-0 border-slate-200 dark:border-zinc-800"
class="border-l h-4 w-0 !p-0 border-slate-200 dark:border-zinc-800"
></div>
<button
on:click={() => castVote(vote == -1 ? 0 : -1)}
class="flex items-center gap-0.5 {buttonColor.tertiary} transition-colors border-0 !pr-2
class="flex flex-row-reverse items-center gap-0.5 h-full {buttonColor.tertiary} transition-colors border-0 px-1.5
{vote == -1 ? shouldShowVoteColor(vote, 'downvotes') : ''}"
>
<Icon src={ChevronDown} size="18" mini />