impr: switch menus to attachment based vs cursed div wrapper

This commit is contained in:
James Xylight committed 2025-08-28 21:18:43 -07:00
1 parent 078fdc2c71
commit 2891c68494
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"
+2 -1
View File
@@ -105,8 +105,9 @@
href="/create"
/>
<Menu placement="bottom">
{#snippet target()}
{#snippet target(attachment)}
<button
{@attach attachment}
class="w-10 h-10 rounded-full border-slate-200 dark:border-zinc-700
transition-all bg-slate-50 dark:bg-zinc-900 relative
hover:bg-slate-200 dark:hover:bg-zinc-700 group cursor-pointer"
+2 -4
View File
@@ -17,7 +17,6 @@
MenuButton,
MenuDivider,
modal,
Modal,
Option,
Select,
Spinner,
@@ -41,8 +40,6 @@
UserCircle,
UserGroup,
} from 'svelte-hero-icons'
let showInstance = $state(false)
</script>
{#snippet siteSnippet()}
@@ -140,8 +137,9 @@
<!--svelte-ignore a11y_no_static_element_interactions-->
<div onclick={e => e.stopPropagation()}>
<Select bind:value={theme.colorScheme} size="sm">
{#snippet target()}
{#snippet target(attachment)}
<MenuButton
{@attach attachment}
icon={theme.colorScheme == 'system'
? ComputerDesktop
: theme.colorScheme == 'light'
@@ -25,8 +25,9 @@
</script>
<Menu placement="bottom">
{#snippet target()}
{#snippet target(attachment)}
<Button
{@attach attachment}
color="tertiary"
alignment="left"
size="md"
+2 -1
View File
@@ -83,8 +83,9 @@
icon={Cog6Tooth}
/>
<Select bind:value={theme.colorScheme} size="sm">
{#snippet target()}
{#snippet target(attachment)}
<SidebarButton
{@attach attachment}
label={$t('nav.menu.colorscheme.label')}
icon={theme.colorScheme == 'system'
? ComputerDesktop