impr: switch menus to attachment based vs cursed div wrapper
This commit is contained in:
20 files changed
+93
-93
No files matched your search
@@ -66,8 +66,9 @@
|
||||
<CommentModerationMenu bind:item={comment} />
|
||||
{/if}
|
||||
<Menu placement="bottom">
|
||||
{#snippet target()}
|
||||
{#snippet target(attachment)}
|
||||
<Button
|
||||
{@attach attachment}
|
||||
title={$t('comment.actions.label')}
|
||||
color="tertiary"
|
||||
rounding="pill"
|
||||
|
||||
@@ -270,8 +270,8 @@
|
||||
</Button>
|
||||
{/if}
|
||||
<Menu placement="top-end">
|
||||
{#snippet target()}
|
||||
<Button size="square-md" rounding="pill">
|
||||
{#snippet target(attachment)}
|
||||
<Button {@attach attachment} size="square-md" rounding="pill">
|
||||
{#snippet prefix()}
|
||||
<Icon src={EllipsisHorizontal} size="16" mini />
|
||||
{/snippet}
|
||||
|
||||
@@ -193,8 +193,8 @@
|
||||
{#if site.data}
|
||||
<div class="flex gap-2 flex-wrap flex-row">
|
||||
<Menu class="gap-px">
|
||||
{#snippet target()}
|
||||
<button type="button">
|
||||
{#snippet target(attachment)}
|
||||
<button {@attach attachment} type="button">
|
||||
<Badge color="blue-subtle">
|
||||
<Icon src={Plus} micro size="14" />
|
||||
{$t('common.add')}
|
||||
|
||||
@@ -170,8 +170,8 @@
|
||||
</Button>
|
||||
{/if}
|
||||
<Menu placement="top-end">
|
||||
{#snippet target()}
|
||||
<Button size="custom" rounding="pill" class="h-8.5 aspect-square">
|
||||
{#snippet target(attachment)}
|
||||
<Button {@attach attachment} size="custom" rounding="pill" class="h-8.5 aspect-square">
|
||||
{#snippet prefix()}
|
||||
<Icon src={EllipsisHorizontal} size="16" mini />
|
||||
{/snippet}
|
||||
|
||||
@@ -24,8 +24,9 @@
|
||||
</script>
|
||||
|
||||
<Menu placement="bottom" class="top-0 h-[26px] w-[26px] ">
|
||||
{#snippet target()}
|
||||
{#snippet target(attachment)}
|
||||
<Button
|
||||
{@attach attachment}
|
||||
class="w-[26px] h-[26px] hover:text-green-500! dark:text-zinc-400 text-slate-600"
|
||||
size="square-md"
|
||||
color="tertiary"
|
||||
|
||||
@@ -19,10 +19,11 @@
|
||||
Trash,
|
||||
} from 'svelte-hero-icons'
|
||||
import { amMod, ban, isAdmin, remove, viewVotes } from './moderation'
|
||||
import type { Attachment } from 'svelte/attachments'
|
||||
|
||||
interface Props {
|
||||
item: PostView | CommentView
|
||||
target: Snippet<[boolean]>
|
||||
target: Snippet<[Attachment, boolean]>
|
||||
}
|
||||
|
||||
let { item = $bindable(), target: passedTarget }: Props = $props()
|
||||
@@ -75,8 +76,8 @@
|
||||
</script>
|
||||
|
||||
<Menu placement="bottom-end">
|
||||
{#snippet target()}
|
||||
{@render passedTarget(acting)}
|
||||
{#snippet target(attachment)}
|
||||
{@render passedTarget(attachment, acting)}
|
||||
{/snippet}
|
||||
{#if (profile.current?.user && amMod(profile.current.user, item.community)) || (profile.current?.user && isAdmin(profile.current.user))}
|
||||
<MenuDivider showLabel>
|
||||
|
||||
@@ -134,8 +134,9 @@
|
||||
{#if profile.current?.user && (amMod(profile.current.user, post.community) || isAdmin(profile.current.user))}
|
||||
{#await import('$lib/components/lemmy/moderation/ModerationMenu.svelte') then { default: ModerationMenu }}
|
||||
<ModerationMenu bind:item={post}>
|
||||
{#snippet target(acting)}
|
||||
{#snippet target(attachment, acting)}
|
||||
<Button
|
||||
{@attach attachment}
|
||||
size="custom"
|
||||
color="secondary"
|
||||
rounding="pill"
|
||||
@@ -172,8 +173,9 @@
|
||||
{/if}
|
||||
|
||||
<Menu placement="bottom-end">
|
||||
{#snippet target()}
|
||||
{#snippet target(popover)}
|
||||
<Button
|
||||
{@attach popover}
|
||||
title={$t('post.actions.more.label')}
|
||||
color="secondary"
|
||||
rounding="pill"
|
||||
|
||||
Reference in new issue
Block a user