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