From 6fd02cffbbcaf67f2209048a39a182ff1a33c174 Mon Sep 17 00:00:00 2001 From: Kieran Date: Mon, 22 Jan 2024 13:52:18 +0000 Subject: [PATCH] feat: generic nostr.com client config --- packages/app/config/nostr.json | 43 ++++++++++++++++ packages/app/src/Pages/DonatePage.tsx | 73 +++++++++++++++------------ 2 files changed, 84 insertions(+), 32 deletions(-) create mode 100644 packages/app/config/nostr.json diff --git a/packages/app/config/nostr.json b/packages/app/config/nostr.json new file mode 100644 index 00000000..33caafaf --- /dev/null +++ b/packages/app/config/nostr.json @@ -0,0 +1,43 @@ +{ + "appName": "Nostr", + "appNameCapitalized": "Nostr", + "appTitle": "Nostr", + "hostname": "nostr.com", + "nip05Domain": "nostr.com", + "favicon": "public/favicon.ico", + "appleTouchIconUrl": "/nostrich_512.png", + "navLogo": null, + "publicDir": "public/snort", + "httpCache": "", + "animalNamePlaceholders": false, + "features": { + "analytics": false, + "subscriptions": false, + "deck": false, + "zapPool": false, + "notificationGraph": true, + "communityLeaders": false + }, + "signUp": { + "moderation": true, + "defaultFollows": [] + }, + "defaultPreferences": { + "hideMutedNotes": false + }, + "media": { + "bypassImgProxyError": false, + "preferLargeMedia": true + }, + "noteCreatorToast": true, + "hideFromNavbar": ["/graph"], + "deckSubKind": 1, + "showPowIcon": true, + "eventLinkPrefix": "nevent", + "profileLinkPrefix": "nprofile", + "defaultRelays": { + "wss://relay.snort.social/": { "read": true, "write": true }, + "wss://nostr.wine/": { "read": true, "write": false }, + "wss://eden.nostr.land/": { "read": true, "write": false } + } +} diff --git a/packages/app/src/Pages/DonatePage.tsx b/packages/app/src/Pages/DonatePage.tsx index 4f490a75..c3067bc3 100644 --- a/packages/app/src/Pages/DonatePage.tsx +++ b/packages/app/src/Pages/DonatePage.tsx @@ -64,10 +64,6 @@ const DonatePage = () => { const [today, setSumToday] = useState(); const [onChain, setOnChain] = useState(""); const api = new SnortApi(ApiHost); - const zapPool = useSyncExternalStore( - c => unwrap(ZapPoolController).hook(c), - () => unwrap(ZapPoolController).snapshot(), - ); async function getOnChainAddress() { const { address } = await api.onChainDonation(); @@ -178,34 +174,7 @@ const DonatePage = () => { )} - {CONFIG.features.zapPool && ( - <> -

- -

-

- -

-

- - - -

- b.pubkey === bech32ToHex(SnortPubKey) && b.type === ZapPoolRecipientType.Generic) ?? { - type: ZapPoolRecipientType.Generic, - pubkey: bech32ToHex(SnortPubKey), - split: 0, - sum: 0, - } - } - /> - - )} +

@@ -228,4 +197,44 @@ const DonatePage = () => { ); }; +function ZapPoolDonateSection() { + if (!CONFIG.features.zapPool) { + return; + } + // eslint-disable-next-line react-hooks/rules-of-hooks + const zapPool = useSyncExternalStore( + c => unwrap(ZapPoolController).hook(c), + () => unwrap(ZapPoolController).snapshot(), + ); + + return ( + <> +

+ +

+

+ +

+

+ + + +

+ b.pubkey === bech32ToHex(SnortPubKey) && b.type === ZapPoolRecipientType.Generic) ?? { + type: ZapPoolRecipientType.Generic, + pubkey: bech32ToHex(SnortPubKey), + split: 0, + sum: 0, + } + } + /> + + ); +} + export default DonatePage;