don't show yourself as zap target
This commit is contained in:
parent
5e9d35fb25
commit
677ca771c8
@ -1,5 +1,6 @@
|
|||||||
import "./Zap.css";
|
import "./Zap.css";
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
import { decode as invoiceDecode } from "light-bolt11-decoder";
|
import { decode as invoiceDecode } from "light-bolt11-decoder";
|
||||||
import { bytesToHex } from "@noble/hashes/utils";
|
import { bytesToHex } from "@noble/hashes/utils";
|
||||||
@ -10,6 +11,7 @@ import { HexKey, TaggedRawEvent } from "Nostr";
|
|||||||
import Event from "Nostr/Event";
|
import Event from "Nostr/Event";
|
||||||
import Text from "Element/Text";
|
import Text from "Element/Text";
|
||||||
import ProfileImage from "Element/ProfileImage";
|
import ProfileImage from "Element/ProfileImage";
|
||||||
|
import { RootState } from "State/Store";
|
||||||
|
|
||||||
function findTag(e: TaggedRawEvent, tag: string) {
|
function findTag(e: TaggedRawEvent, tag: string) {
|
||||||
const maybeTag = e.tags.find((evTag) => {
|
const maybeTag = e.tags.find((evTag) => {
|
||||||
@ -80,12 +82,13 @@ export function parseZap(zap: TaggedRawEvent): ParsedZap {
|
|||||||
|
|
||||||
const Zap = ({ zap }: { zap: ParsedZap }) => {
|
const Zap = ({ zap }: { zap: ParsedZap }) => {
|
||||||
const { amount, content, zapper, valid, p } = zap
|
const { amount, content, zapper, valid, p } = zap
|
||||||
|
const pubKey = useSelector((s: RootState) => s.login.publicKey)
|
||||||
|
|
||||||
return valid ? (
|
return valid ? (
|
||||||
<div className="zap note card">
|
<div className="zap note card">
|
||||||
<div className="header">
|
<div className="header">
|
||||||
{zapper && <ProfileImage pubkey={zapper} />}
|
{zapper && <ProfileImage pubkey={zapper} />}
|
||||||
<ProfileImage pubkey={p} />
|
{p !== pubKey && <ProfileImage pubkey={p} />}
|
||||||
<div className="amount">
|
<div className="amount">
|
||||||
<span className="amount-number">{formatShort(amount)}</span> sats
|
<span className="amount-number">{formatShort(amount)}</span> sats
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user