Replace the input with a "Login to chat" button for logged-out users

This commit is contained in:
dtonon 2026-06-23 17:48:19 +02:00
parent dc164bd8e2
commit 55e6ed2ca8

View file

@ -456,7 +456,14 @@
{sendError} {sendError}
</div> </div>
{/if} {/if}
{#if joinToChat} {#if !auth.user}
<button
onclick={openLogin}
class="bg-accent hover:bg-accent-hover w-full rounded px-3 py-2 text-sm font-medium text-white"
>
Login to chat
</button>
{:else if joinToChat}
<button <button
onclick={onJoinToChat} onclick={onJoinToChat}
class="bg-accent hover:bg-accent-hover w-full rounded px-3 py-2 text-sm font-medium text-white" class="bg-accent hover:bg-accent-hover w-full rounded px-3 py-2 text-sm font-medium text-white"
@ -473,7 +480,7 @@
autoGrow autoGrow
maxRows={10} maxRows={10}
disabled={sending} disabled={sending}
placeholder={auth.user ? "Message..." : "Login to send messages"} placeholder="Message..."
{contextPubkeys} {contextPubkeys}
textareaClass="block w-full resize-none rounded border border-neutral-200 dark:border-neutral-700 py-2 pl-3 pr-11 text-sm focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50" textareaClass="block w-full resize-none rounded border border-neutral-200 dark:border-neutral-700 py-2 pl-3 pr-11 text-sm focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50"
/> />