rename editable to selectable.

This commit is contained in:
fiatjaf 2023-06-20 15:33:29 -03:00
parent 015cfd857c
commit 30c8eb83b2
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1

View File

@ -30,7 +30,7 @@ object Components {
"npub", "npub",
NIP19.encode(XOnlyPublicKey(bytes32)), NIP19.encode(XOnlyPublicKey(bytes32)),
Some( Some(
editable( selectable(
store, store,
NIP19.encode(XOnlyPublicKey(bytes32)) NIP19.encode(XOnlyPublicKey(bytes32))
) )
@ -49,7 +49,7 @@ object Components {
"nsec", "nsec",
NIP19.encode(PrivateKey(bytes32)), NIP19.encode(PrivateKey(bytes32)),
Some( Some(
editable( selectable(
store, store,
NIP19.encode(PrivateKey(bytes32)) NIP19.encode(PrivateKey(bytes32))
) )
@ -59,7 +59,7 @@ object Components {
"npub", "npub",
NIP19.encode(PrivateKey(bytes32).publicKey.xonly), NIP19.encode(PrivateKey(bytes32).publicKey.xonly),
Some( Some(
editable( selectable(
store, store,
NIP19.encode(PrivateKey(bytes32).publicKey.xonly) NIP19.encode(PrivateKey(bytes32).publicKey.xonly)
) )
@ -86,7 +86,7 @@ object Components {
"note", "note",
NIP19.encode(bytes32), NIP19.encode(bytes32),
Some( Some(
editable( selectable(
store, store,
NIP19.encode(bytes32) NIP19.encode(bytes32)
) )
@ -104,7 +104,7 @@ object Components {
entry( entry(
"event id (hex)", "event id (hex)",
evp.id, evp.id,
Some(editable(store, evp.id)) Some(selectable(store, evp.id))
), ),
relayHints(store, evp.relays), relayHints(store, evp.relays),
evp.author.map { pk => evp.author.map { pk =>
@ -114,7 +114,7 @@ object Components {
entry( entry(
"note", "note",
NIP19.encode(ByteVector32.fromValidHex(evp.id)), NIP19.encode(ByteVector32.fromValidHex(evp.id)),
Some(editable(store, NIP19.encode(ByteVector32.fromValidHex(evp.id)))) Some(selectable(store, NIP19.encode(ByteVector32.fromValidHex(evp.id))))
) )
) )
@ -129,20 +129,20 @@ object Components {
entry( entry(
"private key (hex)", "private key (hex)",
k.value.toHex, k.value.toHex,
Some(editable(store, k.value.toHex)) Some(selectable(store, k.value.toHex))
) )
}, },
sk.map { k => sk.map { k =>
entry( entry(
"nsec", "nsec",
NIP19.encode(k), NIP19.encode(k),
Some(editable(store, NIP19.encode(k))) Some(selectable(store, NIP19.encode(k)))
) )
}, },
entry( entry(
"public key (hex)", "public key (hex)",
pp.pubkey.value.toHex, pp.pubkey.value.toHex,
Some(editable(store, pp.pubkey.value.toHex)) Some(selectable(store, pp.pubkey.value.toHex))
), ),
relayHints( relayHints(
store, store,
@ -152,7 +152,7 @@ object Components {
entry( entry(
"npub", "npub",
NIP19.encode(pp.pubkey), NIP19.encode(pp.pubkey),
Some(editable(store, NIP19.encode(pp.pubkey))) Some(selectable(store, NIP19.encode(pp.pubkey)))
), ),
nip19_21(store, "nprofile", NIP19.encode(pp)) nip19_21(store, "nprofile", NIP19.encode(pp))
) )
@ -171,7 +171,7 @@ object Components {
entry("kind", addr.kind.toString), entry("kind", addr.kind.toString),
relayHints(store, addr.relays), relayHints(store, addr.relays),
nip19_21(store, "naddr", NIP19.encode(addr)), nip19_21(store, "naddr", NIP19.encode(addr)),
entry("nip33 'a' tag", nip33atag, Some(editable(store, nip33atag))) entry("nip33 'a' tag", nip33atag, Some(selectable(store, nip33atag)))
) )
} }
@ -296,7 +296,7 @@ object Components {
entry( entry(
"note", "note",
NIP19.encode(ByteVector32.fromValidHex(id)), NIP19.encode(ByteVector32.fromValidHex(id)),
Some(editable(store, NIP19.encode(ByteVector32.fromValidHex(id)))) Some(selectable(store, NIP19.encode(ByteVector32.fromValidHex(id))))
) )
) )
) )
@ -304,13 +304,13 @@ object Components {
private def entry( private def entry(
key: String, key: String,
value: String, value: String,
editLink: Option[Resource[IO, HtmlSpanElement[IO]]] = None selectLink: Option[Resource[IO, HtmlSpanElement[IO]]] = None
): Resource[IO, HtmlDivElement[IO]] = ): Resource[IO, HtmlDivElement[IO]] =
div( div(
cls := "flex items-center space-x-3", cls := "flex items-center space-x-3",
span(cls := "font-bold", key + " "), span(cls := "font-bold", key + " "),
span(Styles.mono, cls := "max-w-xl break-all", value), span(Styles.mono, cls := "max-w-xl break-all", value),
editLink selectLink
) )
private def nip19_21( private def nip19_21(
@ -321,7 +321,7 @@ object Components {
div( div(
span(cls := "font-bold", key + " "), span(cls := "font-bold", key + " "),
span(Styles.mono, cls := "break-all", code), span(Styles.mono, cls := "break-all", code),
editable(store, code), selectable(store, code),
a( a(
href := "nostr:" + code, href := "nostr:" + code,
external external
@ -452,7 +452,7 @@ object Components {
) )
} }
private def editable( private def selectable(
store: Store, store: Store,
code: String code: String
): Resource[IO, HtmlSpanElement[IO]] = ): Resource[IO, HtmlSpanElement[IO]] =