Fix some modal bugs

This commit is contained in:
Jon Staab
2025-12-08 09:19:41 -08:00
parent df56af9b0e
commit a2f59a5b1b
3 changed files with 40 additions and 30 deletions

View File

@@ -46,20 +46,20 @@
</script>
<div class="col-2">
<Button class="btn btn-primary w-full" onclick={showEmojiPicker}>
<Icon size={4} icon={SmileCircle} />
Send Reaction
</Button>
<Button class="btn btn-neutral w-full" onclick={sendReply}>
<Icon size={4} icon={Reply} />
Send Reply
<Button class="btn btn-neutral" onclick={showInfo}>
<Icon size={4} icon={Code2} />
Message Info
</Button>
<Button class="btn btn-neutral w-full" onclick={copyText}>
<Icon size={4} icon={Copy} />
Copy Text
</Button>
<Button class="btn btn-neutral" onclick={showInfo}>
<Icon size={4} icon={Code2} />
Message Details
<Button class="btn btn-neutral w-full" onclick={sendReply}>
<Icon size={4} icon={Reply} />
Send Reply
</Button>
<Button class="btn btn-primary w-full" onclick={showEmojiPicker}>
<Icon size={4} icon={SmileCircle} />
Send Reaction
</Button>
</div>

View File

@@ -58,12 +58,12 @@
{#if event.pubkey === $pubkey}
<Button class="btn btn-neutral text-error" onclick={showDelete}>
<Icon size={4} icon={TrashBin2} />
Delete
Delete Message
</Button>
{/if}
<Button class="btn btn-neutral" onclick={showInfo}>
<Icon size={4} icon={Code2} />
Show JSON
Message Info
</Button>
{#if path}
<Link class="btn btn-neutral" href={path}>
@@ -71,18 +71,18 @@
View Details
</Link>
{/if}
<Button class="btn btn-neutral w-full" onclick={sendReply}>
<Icon size={4} icon={Reply} />
Reply
</Button>
<Button class="btn btn-neutral w-full" onclick={showEmojiPicker}>
<Icon size={4} icon={SmileCircle} />
React
</Button>
{#if ENABLE_ZAPS}
<ZapButton replaceState {url} {event} class="btn btn-neutral w-full">
<Icon size={4} icon={Bolt} />
Zap
Send Zap
</ZapButton>
{/if}
<Button class="btn btn-neutral w-full" onclick={sendReply}>
<Icon size={4} icon={Reply} />
Send Reply
</Button>
<Button class="btn btn-neutral w-full" onclick={showEmojiPicker}>
<Icon size={4} icon={SmileCircle} />
Send Reaction
</Button>
</div>

View File

@@ -11,12 +11,20 @@
const {onClose = noop, fullscreen = false, children}: Props = $props()
const extraClass = $derived(
!fullscreen &&
const wrapperClass = $derived(
cx("absolute inset-0 flex sm:relative pointer-events-none", {
"items-center justify-center": fullscreen,
"items-end sm:w-[520px] sm:items-center": !fullscreen,
}),
)
const innerClass = $derived(
cx(
"bg-alt text-base-content overflow-auto text-base-content shadow-md",
"px-4 py-6 bottom-0 left-0 right-0 top-20 rounded-t-box absolute",
"sm:p-6 sm:max-h-[90vh] sm:w-[520px] sm:rounded-box sm:relative sm:top-0 sm:relative",
"relative text-base-content text-base-content flex-grow pointer-events-auto",
"px-4 py-6 rounded-t-box sm:p-6 sm:rounded-box sm:mt-0",
{
"bg-alt shadow-m max-h-[90vh] scroll-container overflow-auto": !fullscreen,
},
),
)
</script>
@@ -28,7 +36,9 @@
transition:fade={{duration: 300}}
onclick={onClose}>
</button>
<div class="scroll-container relative {extraClass}" transition:fly={{duration: 300}}>
<div class={wrapperClass}>
<div class={innerClass} transition:fly={{duration: 300}}>
{@render children?.()}
</div>
</div>
</div>