From 7ab8eff33a5f2dcd7953ccf99d5baed3e2065027 Mon Sep 17 00:00:00 2001 From: Kieran Date: Thu, 18 May 2023 10:29:27 +0100 Subject: [PATCH] feat: add data providers to zap pool --- packages/app/src/Pages/ZapPool.tsx | 33 +++++++++++++++++++++++++++ packages/app/src/ZapPoolController.ts | 1 + packages/app/src/lang.json | 3 +++ packages/app/src/translations/en.json | 1 + 4 files changed, 38 insertions(+) diff --git a/packages/app/src/Pages/ZapPool.tsx b/packages/app/src/Pages/ZapPool.tsx index c2fe1280..fd45f12a 100644 --- a/packages/app/src/Pages/ZapPool.tsx +++ b/packages/app/src/Pages/ZapPool.tsx @@ -14,6 +14,21 @@ import { useUserProfile } from "Hooks/useUserProfile"; import AsyncButton from "Element/AsyncButton"; import { useWallet } from "Wallet"; +const DataProviders = [ + { + name: "nostr.band", + owner: bech32ToHex("npub1sx9rnd03vs34lp39fvfv5krwlnxpl90f3dzuk8y3cuwutk2gdhdqjz6g8m"), + }, + { + name: "nostr.watch", + owner: bech32ToHex("npub1uac67zc9er54ln0kl6e4qp2y6ta3enfcg7ywnayshvlw9r5w6ehsqq99rx"), + }, + { + name: "nostr.directory", + owner: bech32ToHex("npub1teawtzxh6y02cnp9jphxm2q8u6xxfx85nguwg6ftuksgjctvavvqnsgq5u"), + }, +]; + function ZapTarget({ target }: { target: ZapPoolRecipient }) { const login = useLogin(); const profile = useUserProfile(target.pubkey); @@ -180,6 +195,24 @@ export default function ZapPoolPage() { /> ))} +

+ +

+ {DataProviders.map(a => ( +
+

{a.name}

+ b.pubkey === a.owner && b.type === ZapPoolRecipientType.DataProvider) ?? { + type: ZapPoolRecipientType.DataProvider, + pubkey: a.owner, + split: 0, + sum: 0, + } + } + /> +
+ ))} ); } diff --git a/packages/app/src/ZapPoolController.ts b/packages/app/src/ZapPoolController.ts index f1165cc2..03370e68 100644 --- a/packages/app/src/ZapPoolController.ts +++ b/packages/app/src/ZapPoolController.ts @@ -10,6 +10,7 @@ export enum ZapPoolRecipientType { Generic = 0, Relay = 1, FileHost = 2, + DataProvider = 3, } export interface ZapPoolRecipient { diff --git a/packages/app/src/lang.json b/packages/app/src/lang.json index be5ba4cc..298c44a9 100644 --- a/packages/app/src/lang.json +++ b/packages/app/src/lang.json @@ -319,6 +319,9 @@ "E8a4yq": { "defaultMessage": "Follow some popular accounts" }, + "ELbg9p": { + "defaultMessage": "Data Providers" + }, "EPYwm7": { "defaultMessage": "Your private key is your password. If you lose this key, you will lose access to your account! Copy it and keep it in a safe place. There is no way to reset your private key." }, diff --git a/packages/app/src/translations/en.json b/packages/app/src/translations/en.json index 7bf68850..7a2b0641 100644 --- a/packages/app/src/translations/en.json +++ b/packages/app/src/translations/en.json @@ -104,6 +104,7 @@ "Dt/Zd5": "Media in posts will automatically be shown for selected people, otherwise only the link will show", "DtYelJ": "Transfer", "E8a4yq": "Follow some popular accounts", + "ELbg9p": "Data Providers", "EPYwm7": "Your private key is your password. If you lose this key, you will lose access to your account! Copy it and keep it in a safe place. There is no way to reset your private key.", "EWyQH5": "Global", "Ebl/B2": "Translate to {lang}",