From 9c9d591b46c03c64349911c1c6d14ac22bd985b9 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 18 Oct 2023 10:51:28 -0300 Subject: [PATCH] update examples on protocol handlers. --- extension/options.jsx | 176 +++++++++++++++++++++++++++--------------- 1 file changed, 112 insertions(+), 64 deletions(-) diff --git a/extension/options.jsx b/extension/options.jsx index c7cfb68..690d8d8 100644 --- a/extension/options.jsx +++ b/extension/options.jsx @@ -11,7 +11,7 @@ function Options() { let [relays, setRelays] = useState([]) let [newRelayURL, setNewRelayURL] = useState('') let [policies, setPermissions] = useState([]) - let [protocolHandler, setProtocolHandler] = useState('') + let [protocolHandler, setProtocolHandler] = useState('https://njump.me/{raw}') let [hidingPrivateKey, hidePrivateKey] = useState(true) let [showNotifications, setNotifications] = useState(false) let [messages, setMessages] = useState([]) @@ -83,10 +83,25 @@ function Options() {

nos2x

nostr signer extension

options

-
+
private key: 
-
+
{privKey === '' && } - {privKey && hidingPrivateKey && } - {privKey && !hidingPrivateKey && } + {privKey && hidingPrivateKey && ( + + )} + {privKey && !hidingPrivateKey && ( + + )}
- {privKey && !isKeyValid() &&
private key is invalid!
} + {privKey && !isKeyValid() && ( +
private key is invalid!
+ )} {!hidingPrivateKey && isKeyValid() && (
preferred relays:
-
+
{relays.map(({url, policy}, i) => ( -
+
- +
))}
@@ -156,19 +185,23 @@ function Options() { style={{width: '400px'}} value={newRelayURL} onChange={e => setNewRelayURL(e.target.value)} - onKeyDown={e => { if (e.key === 'Enter') addNewRelay()}} + onKeyDown={e => { + if (e.key === 'Enter') addNewRelay() + }} /> - +
-
- {showProtocolHandlerHelp && (
{`
+                {showProtocolHandlerHelp && (
+                  
{`
+    {raw} = anything after the colon, i.e. the full nip19 bech32 string
     {hex} = hex pubkey for npub or nprofile, hex event id for note or nevent
     {p_or_e} = "p" for npub or nprofile, "e" for note or nevent
     {u_or_n} = "u" for npub or nprofile, "n" for note or nevent
     {relay0} = first relay in a nprofile or nevent
     {relay1} = second relay in a nprofile or nevent
     {relay2} = third relay in a nprofile or nevent
-    {raw} = anything after the colon, i.e. the full nip19 bech32 string
     {hrp} = human-readable prefix of the nip19 string
 
     examples:
-      - https://nostr.guru/{p_or_e}/{hex}
-      - https://brb.io/{u_or_n}/{hex}
-      - https://notes.blockcore.net/{p_or_e}/{hex}
-                `}
)} + - https://njump.me/{raw} + - https://snort.social/{raw} + - https://nostr.band/{raw} + `}
+ )}
)}
-