feat: zaps #78
@ -1,5 +1,6 @@
|
||||
|
||||
import "./Zap.css";
|
||||
import { useMemo } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
This is wrong, were not using this format anymore, can you revert to previous? The This is wrong, were not using this format anymore, can you revert to previous?
The `description` tag contains the zap note and the hash of this should match the description hash of the invoice
|
||||
// @ts-expect-error
|
||||
import { decode as invoiceDecode } from "light-bolt11-decoder";
|
||||
import { bytesToHex } from "@noble/hashes/utils";
|
||||
@ -10,6 +11,7 @@ import { HexKey, TaggedRawEvent } from "Nostr";
|
||||
This is wrong, were not using this format anymore, can you revert to previous? The This is wrong, were not using this format anymore, can you revert to previous?
The `description` tag contains the zap note and the hash of this should match the description hash of the invoice
This is wrong, were not using this format anymore, can you revert to previous? The This is wrong, were not using this format anymore, can you revert to previous?
The `description` tag contains the zap note and the hash of this should match the description hash of the invoice
|
||||
import Event from "Nostr/Event";
|
||||
import Text from "Element/Text";
|
||||
import ProfileImage from "Element/ProfileImage";
|
||||
import { RootState } from "State/Store";
|
||||
This is wrong, were not using this format anymore, can you revert to previous? The This is wrong, were not using this format anymore, can you revert to previous?
The `description` tag contains the zap note and the hash of this should match the description hash of the invoice
|
||||
|
||||
function findTag(e: TaggedRawEvent, tag: string) {
|
||||
const maybeTag = e.tags.find((evTag) => {
|
||||
@ -80,12 +82,13 @@ export function parseZap(zap: TaggedRawEvent): ParsedZap {
|
||||
This is wrong, were not using this format anymore, can you revert to previous? The This is wrong, were not using this format anymore, can you revert to previous?
The `description` tag contains the zap note and the hash of this should match the description hash of the invoice
This is wrong, were not using this format anymore, can you revert to previous? The This is wrong, were not using this format anymore, can you revert to previous?
The `description` tag contains the zap note and the hash of this should match the description hash of the invoice
|
||||
|
||||
const Zap = ({ zap }: { zap: ParsedZap }) => {
|
||||
const { amount, content, zapper, valid, p } = zap
|
||||
const pubKey = useSelector((s: RootState) => s.login.publicKey)
|
||||
This is wrong, were not using this format anymore, can you revert to previous? The This is wrong, were not using this format anymore, can you revert to previous?
The `description` tag contains the zap note and the hash of this should match the description hash of the invoice
|
||||
|
||||
return valid ? (
|
||||
<div className="zap note card">
|
||||
<div className="header">
|
||||
{zapper && <ProfileImage pubkey={zapper} />}
|
||||
<ProfileImage pubkey={p} />
|
||||
This is wrong, were not using this format anymore, can you revert to previous? The This is wrong, were not using this format anymore, can you revert to previous?
The `description` tag contains the zap note and the hash of this should match the description hash of the invoice
|
||||
{p !== pubKey && <ProfileImage pubkey={p} />}
|
||||
This is wrong, were not using this format anymore, can you revert to previous? The This is wrong, were not using this format anymore, can you revert to previous?
The `description` tag contains the zap note and the hash of this should match the description hash of the invoice
|
||||
<div className="amount">
|
||||
<span className="amount-number">{formatShort(amount)}</span> sats
|
||||
</div>
|
||||
|
||||
This is wrong, were not using this format anymore, can you revert to previous? The This is wrong, were not using this format anymore, can you revert to previous?
The `description` tag contains the zap note and the hash of this should match the description hash of the invoice
This is wrong, were not using this format anymore, can you revert to previous? The This is wrong, were not using this format anymore, can you revert to previous?
The `description` tag contains the zap note and the hash of this should match the description hash of the invoice
|
This is wrong, were not using this format anymore, can you revert to previous?
The
description
tag contains the zap note and the hash of this should match the description hash of the invoiceThis is wrong, were not using this format anymore, can you revert to previous?
The
description
tag contains the zap note and the hash of this should match the description hash of the invoice