bug: zap button not working
This commit is contained in:
parent
9cc163cf1c
commit
27edf5f592
@ -2,25 +2,20 @@ import "./ZapButton.css";
|
|||||||
import { faBolt } from "@fortawesome/free-solid-svg-icons";
|
import { faBolt } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useLongPress } from "use-long-press";
|
import { HexKey } from "@snort/nostr";
|
||||||
|
|
||||||
import { useUserProfile } from "Feed/ProfileFeed";
|
import { useUserProfile } from "Feed/ProfileFeed";
|
||||||
import { HexKey } from "@snort/nostr";
|
|
||||||
import SendSats from "Element/SendSats";
|
import SendSats from "Element/SendSats";
|
||||||
|
|
||||||
const ZapButton = ({ pubkey, lnurl }: { pubkey: HexKey; lnurl?: string }) => {
|
const ZapButton = ({ pubkey, lnurl }: { pubkey: HexKey; lnurl?: string }) => {
|
||||||
const profile = useUserProfile(pubkey);
|
const profile = useUserProfile(pubkey);
|
||||||
const [zap, setZap] = useState(false);
|
const [zap, setZap] = useState(false);
|
||||||
const service = lnurl ?? (profile?.lud16 || profile?.lud06);
|
const service = lnurl ?? (profile?.lud16 || profile?.lud06);
|
||||||
const longPress = useLongPress(() => {
|
|
||||||
console.debug("long press");
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!service) return null;
|
if (!service) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="zap-button" {...longPress()}>
|
<div className="zap-button" onClick={() => setZap(true)}>
|
||||||
<FontAwesomeIcon icon={faBolt} />
|
<FontAwesomeIcon icon={faBolt} />
|
||||||
</div>
|
</div>
|
||||||
<SendSats
|
<SendSats
|
||||||
|
Loading…
Reference in New Issue
Block a user