feat: simple donate page

This commit is contained in:
2023-01-19 00:03:24 +00:00
parent b35608c17d
commit 2f8f8d8075
5 changed files with 72 additions and 2 deletions

25
src/element/ZapButton.tsx Normal file
View File

@ -0,0 +1,25 @@
import { faBolt } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useState } from "react";
import useProfile from "../feed/ProfileFeed";
import { HexKey } from "../nostr";
import LNURLTip from "./LNURLTip";
const ZapButton = ({ pubkey }: { pubkey: HexKey }) => {
const profile = useProfile(pubkey)?.get(pubkey);
const [zap, setZap] = useState(false);
const svc = profile?.lud16 || profile?.lud06;
if (!svc) return null;
return (
<>
<span className="pill" onClick={(e) => setZap(true)}>
<FontAwesomeIcon icon={faBolt} />
</span>
<LNURLTip svc={svc} show={zap} onClose={() => setZap(false)} />
</>
)
}
export default ZapButton;