misc: Move comments to new button system
This commit is contained in:
1 parent
6a5bda814d
commit
42a429326a
2 files changed
+20
-14
No files matched your search
@@ -24,11 +24,15 @@
|
|||||||
dark:border-zinc-700 hover:bg-slate-200 hover:dark:bg-zinc-700 hover:border-slate-300
|
dark:border-zinc-700 hover:bg-slate-200 hover:dark:bg-zinc-700 hover:border-slate-300
|
||||||
hover:dark:border-zinc-600`,
|
hover:dark:border-zinc-600`,
|
||||||
|
|
||||||
|
elevatedLow: `bg-slate-100 dark:bg-zinc-900 border border-slate-200
|
||||||
|
dark:border-zinc-800 hover:bg-slate-200 hover:dark:bg-zinc-800 hover:border-slate-300
|
||||||
|
hover:dark:border-zinc-700`,
|
||||||
|
|
||||||
none: '',
|
none: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
const buttonSize = {
|
const buttonSize = {
|
||||||
sm: 'px-3 py-1',
|
sm: 'px-2 py-1',
|
||||||
md: 'px-3 py-1.5',
|
md: 'px-3 py-1.5',
|
||||||
lg: 'px-4 py-2',
|
lg: 'px-4 py-2',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js'
|
import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js'
|
||||||
import Menu from '$lib/components/ui/menu/Menu.svelte'
|
import Menu from '$lib/components/ui/menu/Menu.svelte'
|
||||||
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
|
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
|
||||||
|
import Button from '$lib/components/input/Button.svelte'
|
||||||
|
|
||||||
export let comment: CommentView
|
export let comment: CommentView
|
||||||
export let replying: boolean = false
|
export let replying: boolean = false
|
||||||
@@ -48,16 +49,10 @@
|
|||||||
bind:vote={comment.my_vote}
|
bind:vote={comment.my_vote}
|
||||||
commentId={comment.comment.id}
|
commentId={comment.comment.id}
|
||||||
/>
|
/>
|
||||||
<button
|
<Button color="elevatedLow" size="sm" on:click={() => (replying = !replying)}>
|
||||||
class="{$userSettings.newComments
|
|
||||||
? Color.borderDark
|
|
||||||
: 'hover:bg-slate-200 hover:dark:bg-zinc-800'} h-full px-2 flex flex-row items-center gap-1
|
|
||||||
rounded-md transition-colors"
|
|
||||||
on:click={() => (replying = !replying)}
|
|
||||||
>
|
|
||||||
<Icon src={ChatBubbleOvalLeft} width={16} height={16} mini />
|
<Icon src={ChatBubbleOvalLeft} width={16} height={16} mini />
|
||||||
<span class="text-xs">Reply</span>
|
<span class="text-xs">Reply</span>
|
||||||
</button>
|
</Button>
|
||||||
<div class="h-full relative">
|
<div class="h-full relative">
|
||||||
<Menu
|
<Menu
|
||||||
let:toggleOpen
|
let:toggleOpen
|
||||||
@@ -65,14 +60,21 @@
|
|||||||
absolute
|
absolute
|
||||||
alignment="bottom-center"
|
alignment="bottom-center"
|
||||||
>
|
>
|
||||||
<button
|
<Button
|
||||||
slot="button"
|
slot="button"
|
||||||
class="{Color.borderDark} h-full px-1 flex flex-row items-center gap-1
|
color="elevatedLow"
|
||||||
rounded-md transition-colors"
|
|
||||||
on:click={toggleOpen}
|
on:click={toggleOpen}
|
||||||
|
size="sm"
|
||||||
|
class="!p-1"
|
||||||
>
|
>
|
||||||
<Icon src={EllipsisHorizontal} width={16} height={16} mini />
|
<Icon
|
||||||
</button>
|
src={EllipsisHorizontal}
|
||||||
|
width={16}
|
||||||
|
height={16}
|
||||||
|
mini
|
||||||
|
slot="icon"
|
||||||
|
/>
|
||||||
|
</Button>
|
||||||
{#if $authData?.token}
|
{#if $authData?.token}
|
||||||
<MenuButton on:click={save}>
|
<MenuButton on:click={save}>
|
||||||
<Icon src={comment.saved ? BookmarkSlash : Bookmark} mini size="16" />
|
<Icon src={comment.saved ? BookmarkSlash : Bookmark} mini size="16" />
|
||||||
|
|||||||
Reference in new issue
Block a user