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
+10 -10
View File
@@ -46,20 +46,20 @@
</script> </script>
<div class="col-2"> <div class="col-2">
<Button class="btn btn-primary w-full" onclick={showEmojiPicker}> <Button class="btn btn-neutral" onclick={showInfo}>
<Icon size={4} icon={SmileCircle} /> <Icon size={4} icon={Code2} />
Send Reaction Message Info
</Button>
<Button class="btn btn-neutral w-full" onclick={sendReply}>
<Icon size={4} icon={Reply} />
Send Reply
</Button> </Button>
<Button class="btn btn-neutral w-full" onclick={copyText}> <Button class="btn btn-neutral w-full" onclick={copyText}>
<Icon size={4} icon={Copy} /> <Icon size={4} icon={Copy} />
Copy Text Copy Text
</Button> </Button>
<Button class="btn btn-neutral" onclick={showInfo}> <Button class="btn btn-neutral w-full" onclick={sendReply}>
<Icon size={4} icon={Code2} /> <Icon size={4} icon={Reply} />
Message Details Send Reply
</Button>
<Button class="btn btn-primary w-full" onclick={showEmojiPicker}>
<Icon size={4} icon={SmileCircle} />
Send Reaction
</Button> </Button>
</div> </div>
+11 -11
View File
@@ -58,12 +58,12 @@
{#if event.pubkey === $pubkey} {#if event.pubkey === $pubkey}
<Button class="btn btn-neutral text-error" onclick={showDelete}> <Button class="btn btn-neutral text-error" onclick={showDelete}>
<Icon size={4} icon={TrashBin2} /> <Icon size={4} icon={TrashBin2} />
Delete Delete Message
</Button> </Button>
{/if} {/if}
<Button class="btn btn-neutral" onclick={showInfo}> <Button class="btn btn-neutral" onclick={showInfo}>
<Icon size={4} icon={Code2} /> <Icon size={4} icon={Code2} />
Show JSON Message Info
</Button> </Button>
{#if path} {#if path}
<Link class="btn btn-neutral" href={path}> <Link class="btn btn-neutral" href={path}>
@@ -71,18 +71,18 @@
View Details View Details
</Link> </Link>
{/if} {/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} {#if ENABLE_ZAPS}
<ZapButton replaceState {url} {event} class="btn btn-neutral w-full"> <ZapButton replaceState {url} {event} class="btn btn-neutral w-full">
<Icon size={4} icon={Bolt} /> <Icon size={4} icon={Bolt} />
Zap Send Zap
</ZapButton> </ZapButton>
{/if} {/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> </div>
+19 -9
View File
@@ -11,13 +11,21 @@
const {onClose = noop, fullscreen = false, children}: Props = $props() const {onClose = noop, fullscreen = false, children}: Props = $props()
const extraClass = $derived( const wrapperClass = $derived(
!fullscreen && cx("absolute inset-0 flex sm:relative pointer-events-none", {
cx( "items-center justify-center": fullscreen,
"bg-alt text-base-content overflow-auto text-base-content shadow-md", "items-end sm:w-[520px] sm:items-center": !fullscreen,
"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", )
),
const innerClass = $derived(
cx(
"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> </script>
@@ -28,7 +36,9 @@
transition:fade={{duration: 300}} transition:fade={{duration: 300}}
onclick={onClose}> onclick={onClose}>
</button> </button>
<div class="scroll-container relative {extraClass}" transition:fly={{duration: 300}}> <div class={wrapperClass}>
{@render children?.()} <div class={innerClass} transition:fly={{duration: 300}}>
{@render children?.()}
</div>
</div> </div>
</div> </div>