feat: zaps in timeline
This commit is contained in:
parent
d08639fffb
commit
1524609a43
@ -1,12 +1,5 @@
|
|||||||
.zap {
|
.zap {
|
||||||
background-color: var(--note-bg);
|
min-height: unset;
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
padding: 10px;
|
|
||||||
border-radius: 16px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.zap .summary {
|
.zap .summary {
|
||||||
@ -15,10 +8,6 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.zap .body a {
|
|
||||||
color: var(--highlight);
|
|
||||||
}
|
|
||||||
|
|
||||||
.zap .amount {
|
.zap .amount {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
@ -72,3 +61,11 @@
|
|||||||
.rest-zaps:before {
|
.rest-zaps:before {
|
||||||
content: ", ";
|
content: ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.note.zap > .header {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note.zap > .body {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
@ -79,12 +79,13 @@ export function parseZap(zap: TaggedRawEvent): ParsedZap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Zap = ({ zap }: { zap: ParsedZap }) => {
|
const Zap = ({ zap }: { zap: ParsedZap }) => {
|
||||||
const { amount, content, zapper, valid } = zap
|
const { amount, content, zapper, valid, p } = zap
|
||||||
|
|
||||||
return valid ? (
|
return valid ? (
|
||||||
<div className="zap">
|
<div className="zap note card">
|
||||||
<div className="summary">
|
<div className="header">
|
||||||
{zapper && <ProfileImage pubkey={zapper} />}
|
{zapper && <ProfileImage pubkey={zapper} />}
|
||||||
|
<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>
|
||||||
|
@ -35,7 +35,7 @@ export default function useTimelineFeed(subject: TimelineSubject, options: Timel
|
|||||||
|
|
||||||
let sub = new Subscriptions();
|
let sub = new Subscriptions();
|
||||||
sub.Id = `timeline:${subject.type}:${subject.discriminator}`;
|
sub.Id = `timeline:${subject.type}:${subject.discriminator}`;
|
||||||
sub.Kinds = new Set([EventKind.TextNote, EventKind.Repost]);
|
sub.Kinds = new Set([EventKind.TextNote, EventKind.Repost, EventKind.ZapReceipt]);
|
||||||
switch (subject.type) {
|
switch (subject.type) {
|
||||||
case "pubkey": {
|
case "pubkey": {
|
||||||
sub.Authors = new Set(subject.items);
|
sub.Authors = new Set(subject.items);
|
||||||
|
Loading…
Reference in New Issue
Block a user