Improve login screen

This commit is contained in:
Jon Staab
2024-10-14 12:35:08 -07:00
parent 1be288dcd9
commit 5621ffd1eb
14 changed files with 196 additions and 56 deletions
+5
View File
@@ -0,0 +1,5 @@
<script lang="ts">
export let value
</script>
{value}
+2 -2
View File
@@ -67,7 +67,7 @@
transition:fly|local={{duration: 200}}
class="mt-2 max-h-[350px] overflow-y-auto overflow-x-hidden shadow-xl {$$props.class} bg-alt"
style={$$props.style}>
{#if term && allowCreate}
{#if term && allowCreate && !items.includes(term)}
<button
class="white-space-nowrap block w-full min-w-0 cursor-pointer overflow-x-hidden text-ellipsis px-4 py-2 text-left transition-all hover:brightness-150"
on:mousedown|preventDefault
@@ -81,7 +81,7 @@
on:mousedown|preventDefault
on:click|preventDefault={() => select(value)}>
{#if index === i}
<div transition:slide|local={{axis: "x"}} class="pr-2">
<div transition:slide|local={{axis: "x"}} class="pr-2 flex items-center">
<Icon icon="alt-arrow-right" />
</div>
{/if}
+7 -7
View File
@@ -1,6 +1,6 @@
import type {JSONContent, PasteRuleMatch, InputRuleMatch} from "@tiptap/core"
import {Editor} from "@tiptap/core"
import {choice} from "@welshman/lib"
import {ctx} from "@welshman/lib"
import {Address} from "@welshman/util"
export const asInline = (extend: Record<string, any>) => ({
@@ -61,23 +61,23 @@ export const getEditorTags = (editor: Editor) => {
attrs.tag.replace(/^#/, "").toLowerCase(),
])
const naddrTags = findNodes("naddr", json).map(({kind, pubkey, identifier, relays}: any) => {
const naddrTags = findNodes("naddr", json).map(({kind, pubkey, identifier, relays = []}: any) => {
const address = new Address(kind, pubkey, identifier).toString()
return ["q", address, choice(relays) || "", pubkey]
return ["q", address, ctx.app.router.fromRelays(relays).getUrl(), pubkey]
})
const neventTags = findNodes("nevent", json).map(({id, author, relays}: any) => [
const neventTags = findNodes("nevent", json).map(({id, author, relays = []}: any) => [
"q",
id,
choice(relays) || "",
ctx.app.router.fromRelays(relays).getUrl(),
author || "",
])
const mentionTags = findNodes("nprofile", json).map(({pubkey, relays}: any) => [
const mentionTags = findNodes("nprofile", json).map(({pubkey, relays = []}: any) => [
"p",
pubkey,
choice(relays) || "",
ctx.app.router.fromRelays(relays).getUrl(),
"",
])