forked from Kieran/snort
commit
c3976668b1
@ -16,7 +16,7 @@ export default function FollowListBase({ pubkeys, title }: FollowListBaseProps)
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="main-content">
|
<div className="main-content">
|
||||||
<div className="flex mt10">
|
<div className="flex mt10 mb10">
|
||||||
<div className="f-grow bold">{title}</div>
|
<div className="f-grow bold">{title}</div>
|
||||||
<button className="transparent" type="button" onClick={() => followAll()}>Follow All</button>
|
<button className="transparent" type="button" onClick={() => followAll()}>Follow All</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -51,7 +51,10 @@ export default function NoteFooter(props: NoteFooterProps) {
|
|||||||
const langNames = new Intl.DisplayNames([...window.navigator.languages], { type: "language" });
|
const langNames = new Intl.DisplayNames([...window.navigator.languages], { type: "language" });
|
||||||
const reactions = useMemo(() => getReactions(related, ev.Id, EventKind.Reaction), [related, ev]);
|
const reactions = useMemo(() => getReactions(related, ev.Id, EventKind.Reaction), [related, ev]);
|
||||||
const reposts = useMemo(() => getReactions(related, ev.Id, EventKind.Repost), [related, ev]);
|
const reposts = useMemo(() => getReactions(related, ev.Id, EventKind.Repost), [related, ev]);
|
||||||
const zaps = useMemo(() => getReactions(related, ev.Id, EventKind.ZapReceipt).map(parseZap).filter(z => z.valid), [related]);
|
const zaps = useMemo(() =>
|
||||||
|
getReactions(related, ev.Id, EventKind.ZapReceipt).map(parseZap).filter(z => z.valid && z.zapper !== ev.PubKey),
|
||||||
|
[related]
|
||||||
|
);
|
||||||
const zapTotal = zaps.reduce((acc, z) => acc + z.amount, 0)
|
const zapTotal = zaps.reduce((acc, z) => acc + z.amount, 0)
|
||||||
const didZap = zaps.some(a => a.zapper === login);
|
const didZap = zaps.some(a => a.zapper === login);
|
||||||
const groupReactions = useMemo(() => {
|
const groupReactions = useMemo(() => {
|
||||||
|
@ -2,17 +2,26 @@
|
|||||||
min-height: unset;
|
min-height: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.zap .header .pfp {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.zap .header {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.zap .header .amount {
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.zap .header .pfp {
|
||||||
|
max-width: 72%;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 520px) {
|
@media (max-width: 520px) {
|
||||||
.zap .header {
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.zap .header .pfp {
|
.zap .header .pfp {
|
||||||
width: 100%;
|
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
}
|
}
|
||||||
.zap .header .amount {
|
|
||||||
font-size: 32px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.zap .summary {
|
.zap .summary {
|
||||||
@ -76,10 +85,6 @@
|
|||||||
content: ", ";
|
content: ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
.note.zap > .header {
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.note.zap > .body {
|
.note.zap > .body {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ import useModeration from "Hooks/useModeration";
|
|||||||
*/
|
*/
|
||||||
export default function useLoginFeed() {
|
export default function useLoginFeed() {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { publicKey: pubKey, privateKey: privKey } = useSelector((s: RootState) => s.login);
|
const { publicKey: pubKey, privateKey: privKey, latestMuted } = useSelector((s: RootState) => s.login);
|
||||||
const { isMuted } = useModeration();
|
const { isMuted } = useModeration();
|
||||||
const db = useDb();
|
const db = useDb();
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ export default function useLoginFeed() {
|
|||||||
dispatch(setMuted(muted))
|
dispatch(setMuted(muted))
|
||||||
|
|
||||||
const newest = getNewest(mutedFeed.store.notes)
|
const newest = getNewest(mutedFeed.store.notes)
|
||||||
if (newest && newest.content.length > 0 && pubKey) {
|
if (newest && newest.content.length > 0 && pubKey && newest.created_at > latestMuted) {
|
||||||
decryptBlocked(newest, pubKey, privKey).then((plaintext) => {
|
decryptBlocked(newest, pubKey, privKey).then((plaintext) => {
|
||||||
try {
|
try {
|
||||||
const blocked = JSON.parse(plaintext)
|
const blocked = JSON.parse(plaintext)
|
||||||
|
@ -123,6 +123,7 @@ export default function ProfilePage() {
|
|||||||
case ProfileTab.Zaps: {
|
case ProfileTab.Zaps: {
|
||||||
return (
|
return (
|
||||||
<div className="main-content">
|
<div className="main-content">
|
||||||
|
<h4 className="zaps-total">{formatShort(zapsTotal)} sats</h4>
|
||||||
{zaps.map(z => <ZapElement showZapped={false} zap={z} />)}
|
{zaps.map(z => <ZapElement showZapped={false} zap={z} />)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@ -180,12 +181,11 @@ export default function ProfilePage() {
|
|||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<IconButton onClick={() => setShowLnQr(true)}>
|
{lnurl && (
|
||||||
<Zap width={14} height={16} />
|
<IconButton onClick={() => setShowLnQr(true)}>
|
||||||
<span className="zap-amount">
|
<Zap width={14} height={16} />
|
||||||
{zapsTotal > 0 && formatShort(zapsTotal)}
|
</IconButton>
|
||||||
</span>
|
)}
|
||||||
</IconButton>
|
|
||||||
{!loggedOut && (
|
{!loggedOut && (
|
||||||
<>
|
<>
|
||||||
<IconButton onClick={() => navigate(`/messages/${hexToBech32("npub", id)}`)}>
|
<IconButton onClick={() => navigate(`/messages/${hexToBech32("npub", id)}`)}>
|
||||||
|
@ -539,3 +539,11 @@ body.scroll-lock {
|
|||||||
.bold {
|
.bold {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.main-content .h4 {
|
||||||
|
margin-bottom: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-content .profile-preview {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user