From daf7a4d4665cb7cb37cafe5cfe20a1b552561152 Mon Sep 17 00:00:00 2001 From: reya Date: Tue, 21 Nov 2023 08:28:41 +0700 Subject: [PATCH] wip --- extension/options.html | 2 +- extension/options.jsx | 207 ++++++++++++++++++++++++++-------------- extension/popup.html | 2 +- extension/popup.jsx | 77 +++++++++------ extension/prompt.html | 2 +- extension/prompt.jsx | 209 ++++++++++++++++++++++++++--------------- package.json | 1 + pnpm-lock.yaml | 56 +++++++++++ 8 files changed, 377 insertions(+), 179 deletions(-) diff --git a/extension/options.html b/extension/options.html index 6887beb..579c8dc 100644 --- a/extension/options.html +++ b/extension/options.html @@ -2,7 +2,7 @@ - nos2x + Nostr Connect (formerly nos2x) diff --git a/extension/options.jsx b/extension/options.jsx index a36d6b6..90b4854 100644 --- a/extension/options.jsx +++ b/extension/options.jsx @@ -6,6 +6,7 @@ import QRCode from 'react-qr-code' import * as Tabs from '@radix-ui/react-tabs' import {LogoIcon} from './icons' import {removePermissions} from './common' +import * as Checkbox from '@radix-ui/react-checkbox' function Options() { let [privKey, setPrivKey] = useState('') @@ -185,22 +186,76 @@ function Options() { className="flex-1 h-9 bg-transparent border px-3 py-1 border-primary rounded-lg placeholder:text-muted" />
- -
+
+ -

Write

- + onCheckedChange={toggleRelayPolicy.bind( + null, + i, + 'write' + )} + className="flex h-6 w-6 appearance-none items-center justify-center rounded-lg bg-white outline-none border border-primary data-[state=checked]:bg-primary data-[state=checked]:border-secondary" + > + + + + + +
+ +
- )} + onCheckedChange={changeHandleNostrLinks} + > + + + + + + + - {showProtocolHandlerHelp && ( -
{`
+                {handleNostrLinks && (
+                  
+
+ + {!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
@@ -404,16 +479,12 @@ function Options() {
       - https://snort.social/{raw}
       - https://nostr.band/{raw}
                 `}
+ )} +
)} - )} + - */} - {/*
- {messages.map((message, i) => ( -
{message}
- ))} -
*/}