From f1d6d32f92d3c2d0dce78811dab90a8f066ce939 Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Tue, 4 Jun 2024 16:55:32 -0300 Subject: [PATCH] feat: zap account directly --- src/features/account/components/header.tsx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/features/account/components/header.tsx b/src/features/account/components/header.tsx index cd95d5945..be74a5b65 100644 --- a/src/features/account/components/header.tsx +++ b/src/features/account/components/header.tsx @@ -75,6 +75,7 @@ const messages = defineMessages({ profileExternal: { id: 'account.profile_external', defaultMessage: 'View profile on {domain}' }, header: { id: 'account.header.alt', defaultMessage: 'Profile header' }, subscribeFeed: { id: 'account.rss_feed', defaultMessage: 'Subscribe to RSS feed' }, + zap: { id: 'zap.send_to', defaultMessage: 'Send zaps to {target}' }, }); interface IHeader { @@ -282,6 +283,10 @@ const Header: React.FC = ({ account }) => { copy(nip19.npubEncode(account.nostr.pubkey!)); }; + const handleZapAccount: React.EventHandler = (e) => { + dispatch(openModal('ZAP_PAY_REQUEST', { account })); + }; + const makeMenu = () => { const menu: Menu = []; @@ -621,8 +626,22 @@ const Header: React.FC = ({ account }) => { ); }; + const renderZapAccount = () => { + return ( + + ); + }; + const info = makeInfo(); const menu = makeMenu(); + const acceptsZaps = account.ditto.accepts_zaps === true; return (
@@ -664,6 +683,7 @@ const Header: React.FC = ({ account }) => { {renderMessageButton()} {renderShareButton()} + {acceptsZaps && renderZapAccount()} {menu.length > 0 && (