rm related prop

This commit is contained in:
Martti Malmi 2024-01-08 11:24:14 +02:00
parent e905b4134d
commit 11e616c612
26 changed files with 30 additions and 88 deletions

View File

@ -19,7 +19,7 @@ module.exports = {
"react-refresh/only-export-components": "warn", "react-refresh/only-export-components": "warn",
"simple-import-sort/imports": "error", "simple-import-sort/imports": "error",
"simple-import-sort/exports": "error", "simple-import-sort/exports": "error",
"@typescript-eslint/no-unused-vars": "warn", "@typescript-eslint/no-unused-vars": "error",
}, },
root: true, root: true,
ignorePatterns: ["build/", "*.test.ts", "*.js"], ignorePatterns: ["build/", "*.test.ts", "*.js"],

View File

@ -95,6 +95,7 @@
"@vitejs/plugin-react": "^4.2.0", "@vitejs/plugin-react": "^4.2.0",
"@webbtc/webln-types": "^2.1.0", "@webbtc/webln-types": "^2.1.0",
"@webscopeio/react-textarea-autocomplete": "^4.9.2", "@webscopeio/react-textarea-autocomplete": "^4.9.2",
"@welldone-software/why-did-you-render": "^8.0.1",
"autoprefixer": "^10.4.16", "autoprefixer": "^10.4.16",
"config": "^3.3.9", "config": "^3.3.9",
"eslint": "^8.48.0", "eslint": "^8.48.0",

View File

@ -296,7 +296,6 @@ export function NoteCreator() {
return ( return (
<Note <Note
data={note.preview as TaggedNostrEvent} data={note.preview as TaggedNostrEvent}
related={[]}
options={{ options={{
showContextMenu: false, showContextMenu: false,
showFooter: false, showFooter: false,
@ -603,7 +602,6 @@ export function NoteCreator() {
</h4> </h4>
<Note <Note
data={note.replyTo} data={note.replyTo}
related={[]}
options={{ options={{
showFooter: false, showFooter: false,
showContextMenu: false, showContextMenu: false,
@ -623,7 +621,6 @@ export function NoteCreator() {
</h4> </h4>
<Note <Note
data={note.quote} data={note.quote}
related={[]}
options={{ options={{
showFooter: false, showFooter: false,
showContextMenu: false, showContextMenu: false,

View File

@ -1,7 +1,7 @@
import "./LongFormText.css"; import "./LongFormText.css";
import { NostrLink, TaggedNostrEvent } from "@snort/system"; import { NostrLink, TaggedNostrEvent } from "@snort/system";
import {useEventReactions, useReactions} from "@snort/system-react"; import { useEventReactions, useReactions } from "@snort/system-react";
import classNames from "classnames"; import classNames from "classnames";
import React, { CSSProperties, useCallback, useRef, useState } from "react"; import React, { CSSProperties, useCallback, useRef, useState } from "react";
import { FormattedMessage, FormattedNumber } from "react-intl"; import { FormattedMessage, FormattedNumber } from "react-intl";

View File

@ -1,5 +1,5 @@
import { normalizeReaction } from "@snort/shared"; import { normalizeReaction } from "@snort/shared";
import { countLeadingZeros, NostrLink, ParsedZap, TaggedNostrEvent } from "@snort/system"; import { countLeadingZeros, NostrLink, TaggedNostrEvent } from "@snort/system";
import { useEventReactions, useReactions, useUserProfile } from "@snort/system-react"; import { useEventReactions, useReactions, useUserProfile } from "@snort/system-react";
import { Menu, MenuItem } from "@szhsin/react-menu"; import { Menu, MenuItem } from "@szhsin/react-menu";
import classNames from "classnames"; import classNames from "classnames";

View File

@ -31,7 +31,7 @@ import Reveal from "./Reveal";
const TEXT_TRUNCATE_LENGTH = 400; const TEXT_TRUNCATE_LENGTH = 400;
export function NoteInner(props: NoteProps) { export function NoteInner(props: NoteProps) {
const { data: ev, related, highlight, options: opt, ignoreModeration = false, className, waitUntilInView } = props; const { data: ev, highlight, options: opt, ignoreModeration = false, className, waitUntilInView } = props;
const baseClassName = classNames("note min-h-[110px] flex flex-col gap-4 card", className); const baseClassName = classNames("note min-h-[110px] flex flex-col gap-4 card", className);
const navigate = useNavigate(); const navigate = useNavigate();

View File

@ -15,7 +15,6 @@ export default function NoteQuote({ link, depth }: { link: NostrLink; depth?: nu
return ( return (
<Note <Note
data={ev.data} data={ev.data}
related={[]}
className="note-quote" className="note-quote"
depth={(depth ?? 0) + 1} depth={(depth ?? 0) + 1}
options={{ options={{

View File

@ -87,7 +87,7 @@ export default function NoteReaction(props: NoteReactionProps) {
}} }}
/> />
</div> </div>
{root ? <Note data={root} options={opt} related={[]} depth={props.depth} /> : null} {root ? <Note data={root} options={opt} depth={props.depth} /> : null}
{!root && refEvent ? ( {!root && refEvent ? (
<p> <p>
<Link to={eventLink(refEvent[1] ?? "", refEvent[2])}> <Link to={eventLink(refEvent[1] ?? "", refEvent[2])}>

View File

@ -1,6 +1,6 @@
import "./Reactions.css"; import "./Reactions.css";
import { NostrLink, ParsedZap, socialGraphInstance, TaggedNostrEvent } from "@snort/system"; import { NostrLink, socialGraphInstance, TaggedNostrEvent } from "@snort/system";
import { useEventReactions, useReactions } from "@snort/system-react"; import { useEventReactions, useReactions } from "@snort/system-react";
import { useEffect, useMemo, useState } from "react"; import { useEffect, useMemo, useState } from "react";
import { FormattedMessage, useIntl } from "react-intl"; import { FormattedMessage, useIntl } from "react-intl";

View File

@ -1,6 +1,6 @@
import "./Thread.css"; import "./Thread.css";
import { EventExt, NostrLink, NostrPrefix, parseNostrLink, TaggedNostrEvent, u256 } from "@snort/system"; import { EventExt, NostrPrefix, parseNostrLink, TaggedNostrEvent, u256 } from "@snort/system";
import classNames from "classnames"; import classNames from "classnames";
import { Fragment, ReactNode, useContext, useMemo, useState } from "react"; import { Fragment, ReactNode, useContext, useMemo, useState } from "react";
import { useIntl } from "react-intl"; import { useIntl } from "react-intl";
@ -11,7 +11,6 @@ import Collapsed from "@/Components/Collapsed";
import Note from "@/Components/Event/Note"; import Note from "@/Components/Event/Note";
import NoteGhost from "@/Components/Event/NoteGhost"; import NoteGhost from "@/Components/Event/NoteGhost";
import { chainKey, ThreadContext, ThreadContextWrapper } from "@/Hooks/useThreadContext"; import { chainKey, ThreadContext, ThreadContextWrapper } from "@/Hooks/useThreadContext";
import { getAllLinkReactions } from "@/Utils";
import messages from "../messages"; import messages from "../messages";
@ -32,12 +31,11 @@ interface SubthreadProps {
isLastSubthread?: boolean; isLastSubthread?: boolean;
active: u256; active: u256;
notes: readonly TaggedNostrEvent[]; notes: readonly TaggedNostrEvent[];
related: readonly TaggedNostrEvent[];
chains: Map<u256, Array<TaggedNostrEvent>>; chains: Map<u256, Array<TaggedNostrEvent>>;
onNavigate: (e: TaggedNostrEvent) => void; onNavigate: (e: TaggedNostrEvent) => void;
} }
const Subthread = ({ active, notes, related, chains, onNavigate }: SubthreadProps) => { const Subthread = ({ active, notes, chains, onNavigate }: SubthreadProps) => {
const renderSubthread = (a: TaggedNostrEvent, idx: number) => { const renderSubthread = (a: TaggedNostrEvent, idx: number) => {
const isLastSubthread = idx === notes.length - 1; const isLastSubthread = idx === notes.length - 1;
const replies = getReplies(a.id, chains); const replies = getReplies(a.id, chains);
@ -60,7 +58,6 @@ const Subthread = ({ active, notes, related, chains, onNavigate }: SubthreadProp
active={active} active={active}
isLastSubthread={isLastSubthread} isLastSubthread={isLastSubthread}
notes={replies} notes={replies}
related={related}
chains={chains} chains={chains}
onNavigate={onNavigate} onNavigate={onNavigate}
/> />
@ -77,7 +74,7 @@ interface ThreadNoteProps extends Omit<SubthreadProps, "notes"> {
isLast: boolean; isLast: boolean;
} }
const ThreadNote = ({ active, note, isLast, isLastSubthread, related, chains, onNavigate }: ThreadNoteProps) => { const ThreadNote = ({ active, note, isLast, isLastSubthread, chains, onNavigate }: ThreadNoteProps) => {
const { formatMessage } = useIntl(); const { formatMessage } = useIntl();
const replies = getReplies(note.id, chains); const replies = getReplies(note.id, chains);
const activeInReplies = replies.map(r => r.id).includes(active); const activeInReplies = replies.map(r => r.id).includes(active);
@ -108,7 +105,6 @@ const ThreadNote = ({ active, note, isLast, isLastSubthread, related, chains, on
active={active} active={active}
isLastSubthread={isLastSubthread} isLastSubthread={isLastSubthread}
notes={replies} notes={replies}
related={related}
chains={chains} chains={chains}
onNavigate={onNavigate} onNavigate={onNavigate}
/> />
@ -118,7 +114,7 @@ const ThreadNote = ({ active, note, isLast, isLastSubthread, related, chains, on
); );
}; };
const TierTwo = ({ active, isLastSubthread, notes, related, chains, onNavigate }: SubthreadProps) => { const TierTwo = ({ active, isLastSubthread, notes, chains, onNavigate }: SubthreadProps) => {
const [first, ...rest] = notes; const [first, ...rest] = notes;
return ( return (
@ -128,7 +124,6 @@ const TierTwo = ({ active, isLastSubthread, notes, related, chains, onNavigate }
onNavigate={onNavigate} onNavigate={onNavigate}
note={first} note={first}
chains={chains} chains={chains}
related={related}
isLastSubthread={isLastSubthread} isLastSubthread={isLastSubthread}
isLast={rest.length === 0} isLast={rest.length === 0}
/> />
@ -142,7 +137,6 @@ const TierTwo = ({ active, isLastSubthread, notes, related, chains, onNavigate }
onNavigate={onNavigate} onNavigate={onNavigate}
note={r} note={r}
chains={chains} chains={chains}
related={related}
isLastSubthread={isLastSubthread} isLastSubthread={isLastSubthread}
isLast={lastReply} isLast={lastReply}
/> />
@ -152,7 +146,7 @@ const TierTwo = ({ active, isLastSubthread, notes, related, chains, onNavigate }
); );
}; };
const TierThree = ({ active, isLastSubthread, notes, related, chains, onNavigate }: SubthreadProps) => { const TierThree = ({ active, isLastSubthread, notes, chains, onNavigate }: SubthreadProps) => {
const [first, ...rest] = notes; const [first, ...rest] = notes;
const replies = getReplies(first.id, chains); const replies = getReplies(first.id, chains);
const hasMultipleNotes = rest.length > 0 || replies.length > 0; const hasMultipleNotes = rest.length > 0 || replies.length > 0;
@ -171,7 +165,6 @@ const TierThree = ({ active, isLastSubthread, notes, related, chains, onNavigate
className={classNames("thread-note", { "is-last-note": isLastSubthread && isLast })} className={classNames("thread-note", { "is-last-note": isLastSubthread && isLast })}
data={first} data={first}
key={first.id} key={first.id}
related={related}
threadChains={chains} threadChains={chains}
/> />
<div className="line-container"></div> <div className="line-container"></div>
@ -182,7 +175,6 @@ const TierThree = ({ active, isLastSubthread, notes, related, chains, onNavigate
active={active} active={active}
isLastSubthread={isLastSubthread} isLastSubthread={isLastSubthread}
notes={replies} notes={replies}
related={related}
chains={chains} chains={chains}
onNavigate={onNavigate} onNavigate={onNavigate}
/> />
@ -275,18 +267,7 @@ export function Thread(props: { onBack?: () => void; disableSpotlight?: boolean
} }
const replies = thread.chains.get(from); const replies = thread.chains.get(from);
if (replies && thread.current) { if (replies && thread.current) {
return ( return <Subthread active={thread.current} notes={replies} chains={thread.chains} onNavigate={navigateThread} />;
<Subthread
active={thread.current}
notes={replies}
related={getAllLinkReactions(
thread.reactions,
replies.map(a => NostrLink.fromEvent(a)),
)}
chains={thread.chains}
onNavigate={navigateThread}
/>
);
} }
} }

View File

@ -1,5 +1,3 @@
import { NostrLink } from "@snort/system";
import { useReactions } from "@snort/system-react";
import { useContext } from "react"; import { useContext } from "react";
import { useArticles } from "@/Feed/ArticlesFeed"; import { useArticles } from "@/Feed/ArticlesFeed";
@ -11,12 +9,6 @@ import Note from "../Event/Note";
export default function Articles() { export default function Articles() {
const data = useArticles(); const data = useArticles();
const deck = useContext(DeckContext); const deck = useContext(DeckContext);
const related = useReactions(
"articles:reactions",
data.data?.map(v => NostrLink.fromEvent(v)) ?? [],
undefined,
true,
);
return ( return (
<> <>
@ -24,7 +16,6 @@ export default function Articles() {
<Note <Note
data={a} data={a}
key={a.id} key={a.id}
related={related.data ?? []}
options={{ options={{
longFormPreview: true, longFormPreview: true,
}} }}

View File

@ -1,5 +1,5 @@
import { NostrLink, NoteCollection, ReqFilter, RequestBuilder } from "@snort/system"; import { NostrLink, NoteCollection, ReqFilter, RequestBuilder } from "@snort/system";
import { useReactions, useRequestBuilder } from "@snort/system-react"; import { useRequestBuilder } from "@snort/system-react";
import { useMemo } from "react"; import { useMemo } from "react";
import { TimelineRenderer } from "@/Components/Feed/TimelineRenderer"; import { TimelineRenderer } from "@/Components/Feed/TimelineRenderer";
@ -18,12 +18,10 @@ export function GenericFeed({ link }: { link: NostrLink }) {
}, [link]); }, [link]);
const evs = useRequestBuilder(NoteCollection, sub); const evs = useRequestBuilder(NoteCollection, sub);
const reactions = useReactions("generic:reactions", evs.data?.map(a => NostrLink.fromEvent(a)) ?? []);
return ( return (
<TimelineRenderer <TimelineRenderer
frags={[{ events: evs.data ?? [], refTime: 0 }]} frags={[{ events: evs.data ?? [], refTime: 0 }]}
related={reactions.data ?? []}
latest={[]} latest={[]}
showLatest={() => { showLatest={() => {
//nothing //nothing

View File

@ -97,7 +97,6 @@ const Timeline = (props: TimelineProps) => {
refTime: mainFeed.at(0)?.created_at ?? unixNow(), refTime: mainFeed.at(0)?.created_at ?? unixNow(),
}, },
]} ]}
related={feed.related ?? []}
latest={latestAuthors} latest={latestAuthors}
showLatest={t => onShowLatest(t)} showLatest={t => onShowLatest(t)}
displayAs={displayAs} displayAs={displayAs}

View File

@ -1,8 +1,8 @@
import "./Timeline.css"; import "./Timeline.css";
import { unixNow } from "@snort/shared"; import { unixNow } from "@snort/shared";
import { EventKind, NostrEvent, NostrLink, TaggedNostrEvent } from "@snort/system"; import { EventKind, NostrEvent, TaggedNostrEvent } from "@snort/system";
import { SnortContext, useReactions } from "@snort/system-react"; import { SnortContext } from "@snort/system-react";
import { ReactNode, useCallback, useContext, useMemo, useState, useSyncExternalStore } from "react"; import { ReactNode, useCallback, useContext, useMemo, useState, useSyncExternalStore } from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
@ -38,12 +38,6 @@ const TimelineFollows = (props: TimelineFollowsProps) => {
cb => FollowsFeed.hook(cb, "*"), cb => FollowsFeed.hook(cb, "*"),
() => FollowsFeed.snapshot(), () => FollowsFeed.snapshot(),
); );
const reactions = useReactions(
"follows-feed-reactions",
feed.map(a => NostrLink.fromEvent(a)),
undefined,
true,
);
const system = useContext(SnortContext); const system = useContext(SnortContext);
const { muted, isEventMuted } = useModeration(); const { muted, isEventMuted } = useModeration();
@ -118,7 +112,6 @@ const TimelineFollows = (props: TimelineFollowsProps) => {
/> />
<TimelineRenderer <TimelineRenderer
frags={[{ events: orderDescending(mainFeed.concat(mixinFiltered)), refTime: latest }]} frags={[{ events: orderDescending(mainFeed.concat(mixinFiltered)), refTime: latest }]}
related={reactions.data ?? []}
latest={latestAuthors} latest={latestAuthors}
showLatest={t => onShowLatest(t)} showLatest={t => onShowLatest(t)}
noteOnClick={props.noteOnClick} noteOnClick={props.noteOnClick}

View File

@ -1,8 +1,7 @@
import { TaggedNostrEvent } from "@snort/system"; import { TaggedNostrEvent } from "@snort/system";
import { ReactNode, useCallback } from "react"; import { ReactNode } from "react";
import Note from "@/Components/Event/Note"; import Note from "@/Components/Event/Note";
import { findTag } from "@/Utils";
export interface TimelineFragment { export interface TimelineFragment {
events: Array<TaggedNostrEvent>; events: Array<TaggedNostrEvent>;
@ -12,7 +11,6 @@ export interface TimelineFragment {
export interface TimelineFragProps { export interface TimelineFragProps {
frag: TimelineFragment; frag: TimelineFragment;
related: Array<TaggedNostrEvent>;
index: number; index: number;
noteRenderer?: (ev: TaggedNostrEvent) => ReactNode; noteRenderer?: (ev: TaggedNostrEvent) => ReactNode;
noteOnClick?: (ev: TaggedNostrEvent) => void; noteOnClick?: (ev: TaggedNostrEvent) => void;

View File

@ -14,7 +14,6 @@ import ProfileImage from "@/Components/User/ProfileImage";
export interface TimelineRendererProps { export interface TimelineRendererProps {
frags: Array<TimelineFragment>; frags: Array<TimelineFragment>;
related: Array<TaggedNostrEvent>;
/** /**
* List of pubkeys who have posted recently * List of pubkeys who have posted recently
*/ */
@ -96,7 +95,6 @@ export function TimelineRenderer(props: TimelineRendererProps) {
<ErrorBoundary key={frag.events[0]?.id + index}> <ErrorBoundary key={frag.events[0]?.id + index}>
<TimelineFragment <TimelineFragment
frag={frag} frag={frag}
related={props.related}
noteRenderer={props.noteRenderer} noteRenderer={props.noteRenderer}
noteOnClick={props.noteOnClick} noteOnClick={props.noteOnClick}
noteContext={props.noteContext} noteContext={props.noteContext}

View File

@ -1,6 +1,5 @@
import { removeUndefined } from "@snort/shared"; import { removeUndefined } from "@snort/shared";
import { NostrEvent, NostrLink, TaggedNostrEvent } from "@snort/system"; import { NostrEvent, NostrLink, TaggedNostrEvent } from "@snort/system";
import { useReactions } from "@snort/system-react";
import classNames from "classnames"; import classNames from "classnames";
import { useState } from "react"; import { useState } from "react";
@ -46,7 +45,6 @@ export default function TrendingNotes({ count = Infinity, small = false }: { cou
const displayAsInitial = small ? "list" : login.feedDisplayAs ?? "list"; const displayAsInitial = small ? "list" : login.feedDisplayAs ?? "list";
const [displayAs, setDisplayAs] = useState<DisplayAs>(displayAsInitial); const [displayAs, setDisplayAs] = useState<DisplayAs>(displayAsInitial);
const { isEventMuted } = useModeration(); const { isEventMuted } = useModeration();
const related = useReactions("trending", trendingNotesData?.map(a => NostrLink.fromEvent(a)) ?? [], undefined, true);
const [modalThread, setModalThread] = useState<NostrLink | undefined>(undefined); const [modalThread, setModalThread] = useState<NostrLink | undefined>(undefined);
if (error && !trendingNotesData) return <ErrorOrOffline error={error} className="p" />; if (error && !trendingNotesData) return <ErrorOrOffline error={error} className="p" />;
@ -78,7 +76,6 @@ export default function TrendingNotes({ count = Infinity, small = false }: { cou
<Note <Note
key={e.id} key={e.id}
data={e as TaggedNostrEvent} data={e as TaggedNostrEvent}
related={related?.data ?? []}
depth={0} depth={0}
options={{ options={{
showFooter: !small, showFooter: !small,

View File

@ -11,10 +11,9 @@ import messages from "../messages";
interface BookmarksProps { interface BookmarksProps {
pubkey: HexKey; pubkey: HexKey;
bookmarks: readonly TaggedNostrEvent[]; bookmarks: readonly TaggedNostrEvent[];
related: readonly TaggedNostrEvent[];
} }
const Bookmarks = ({ pubkey, bookmarks, related }: BookmarksProps) => { const Bookmarks = ({ pubkey, bookmarks }: BookmarksProps) => {
const [onlyPubkey, setOnlyPubkey] = useState<HexKey | "all">("all"); const [onlyPubkey, setOnlyPubkey] = useState<HexKey | "all">("all");
const { publicKey } = useLogin(s => ({ publicKey: s.publicKey })); const { publicKey } = useLogin(s => ({ publicKey: s.publicKey }));
const ps = useMemo(() => { const ps = useMemo(() => {
@ -46,7 +45,6 @@ const Bookmarks = ({ pubkey, bookmarks, related }: BookmarksProps) => {
<Note <Note
key={n.id} key={n.id}
data={n} data={n}
related={related}
options={{ showTime: false, showBookmarked: true, canUnbookmark: publicKey === pubkey }} options={{ showTime: false, showBookmarked: true, canUnbookmark: publicKey === pubkey }}
/> />
); );

View File

@ -130,7 +130,7 @@ export function SnortDeckLayout() {
className="long-form" className="long-form"
onClick={() => setDeckState({})}> onClick={() => setDeckState({})}>
<div onClick={e => e.stopPropagation()}> <div onClick={e => e.stopPropagation()}>
<LongFormText ev={deckState.article} isPreview={false} related={[]} /> <LongFormText ev={deckState.article} isPreview={false} />
</div> </div>
</Modal> </Modal>
</> </>

View File

@ -1,6 +1,6 @@
import { useUserProfile } from "@snort/system-react"; import { useUserProfile } from "@snort/system-react";
import classNames from "classnames"; import classNames from "classnames";
import { useEffect, useState } from "react"; import { useEffect, useMemo, useState } from "react";
import { FormattedMessage, FormattedNumber, useIntl } from "react-intl"; import { FormattedMessage, FormattedNumber, useIntl } from "react-intl";
import { Link, useNavigate } from "react-router-dom"; import { Link, useNavigate } from "react-router-dom";
@ -89,6 +89,12 @@ const WalletBalance = () => {
} }
}, [wallet]); }, [wallet]);
const msgValues = useMemo(() => {
return {
amount: <FormattedNumber style="currency" currency="USD" value={(rates?.ask ?? 0) * (balance ?? 0) * 1e-8} />,
};
}, [balance, rates]);
return ( return (
<div className="w-max flex flex-col max-xl:hidden"> <div className="w-max flex flex-col max-xl:hidden">
<div className="grow flex items-center justify-between"> <div className="grow flex items-center justify-between">
@ -101,15 +107,7 @@ const WalletBalance = () => {
</Link> </Link>
</div> </div>
<div className="text-secondary text-sm"> <div className="text-secondary text-sm">
<FormattedMessage <FormattedMessage defaultMessage="~{amount}" id="3QwfJR" values={msgValues} />
defaultMessage="~{amount}"
id="3QwfJR"
values={{
amount: (
<FormattedNumber style="currency" currency="USD" value={(rates?.ask ?? 0) * (balance ?? 0) * 1e-8} />
),
}}
/>
</div> </div>
</div> </div>
); );

View File

@ -5,7 +5,6 @@ import {
encodeTLVEntries, encodeTLVEntries,
EventKind, EventKind,
MetadataCache, MetadataCache,
NostrLink,
NostrPrefix, NostrPrefix,
TLVEntryType, TLVEntryType,
tryParseNostrLink, tryParseNostrLink,
@ -54,7 +53,7 @@ import ProfileTab, {
RelaysTab, RelaysTab,
ZapsProfileTab, ZapsProfileTab,
} from "@/Pages/Profile/ProfileTab"; } from "@/Pages/Profile/ProfileTab";
import { findTag, getLinkReactions, hexToBech32, parseId, unwrap } from "@/Utils"; import { findTag, hexToBech32, parseId, unwrap } from "@/Utils";
import { EmailRegex } from "@/Utils/Const"; import { EmailRegex } from "@/Utils/Const";
import { ZapTarget } from "@/Utils/Zapper"; import { ZapTarget } from "@/Utils/Zapper";

View File

@ -1,5 +1,4 @@
import { HexKey, NostrLink, NostrPrefix } from "@snort/system"; import { HexKey, NostrLink, NostrPrefix } from "@snort/system";
import { useReactions } from "@snort/system-react";
import { FormattedMessage } from "react-intl"; import { FormattedMessage } from "react-intl";
import { default as ZapElement } from "@/Components/Event/Zap"; import { default as ZapElement } from "@/Components/Event/Zap";
@ -61,8 +60,7 @@ export function RelaysTab({ id }: { id: HexKey }) {
export function BookMarksTab({ id }: { id: HexKey }) { export function BookMarksTab({ id }: { id: HexKey }) {
const bookmarks = useBookmarkList(id); const bookmarks = useBookmarkList(id);
const reactions = useReactions(`bookmark:reactions:{id}`, bookmarks.map(NostrLink.fromEvent)); return <Bookmarks pubkey={id} bookmarks={bookmarks} />;
return <Bookmarks pubkey={id} bookmarks={bookmarks} related={reactions.data ?? []} />;
} }
const ProfileTab = { const ProfileTab = {

View File

@ -5,7 +5,6 @@ import { useNavigate } from "react-router-dom";
import LndLogo from "@/assets/img/lnd-logo.png"; import LndLogo from "@/assets/img/lnd-logo.png";
import AlbyIcon from "@/Components/Icons/Alby"; import AlbyIcon from "@/Components/Icons/Alby";
import BlueWallet from "@/Components/Icons/BlueWallet"; import BlueWallet from "@/Components/Icons/BlueWallet";
import CashuIcon from "@/Components/Icons/Cashu";
import Icon from "@/Components/Icons/Icon"; import Icon from "@/Components/Icons/Icon";
import NostrIcon from "@/Components/Icons/Nostrich"; import NostrIcon from "@/Components/Icons/Nostrich";

View File

@ -25,7 +25,6 @@
"@types/node": "^20.5.9", "@types/node": "^20.5.9",
"@types/uuid": "^9.0.2", "@types/uuid": "^9.0.2",
"@types/ws": "^8.5.5", "@types/ws": "^8.5.5",
"@welldone-software/why-did-you-render": "^8.0.1",
"jest": "^29.5.0", "jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0", "jest-environment-jsdom": "^29.5.0",
"ts-jest": "^29.1.0", "ts-jest": "^29.1.0",

View File

@ -320,7 +320,6 @@ export class NostrSystem extends EventEmitter<NostrSystemEvents> implements Syst
fNew.forEach(f => { fNew.forEach(f => {
const alreadyHave = inMemoryDB.findArray(f).map(e => { const alreadyHave = inMemoryDB.findArray(f).map(e => {
console.log("got from inMemoryDB", e);
this.HandleEvent(e); this.HandleEvent(e);
return e.id; return e.id;
}); });

View File

@ -2954,6 +2954,7 @@ __metadata:
"@void-cat/api": ^1.0.12 "@void-cat/api": ^1.0.12
"@webbtc/webln-types": ^2.1.0 "@webbtc/webln-types": ^2.1.0
"@webscopeio/react-textarea-autocomplete": ^4.9.2 "@webscopeio/react-textarea-autocomplete": ^4.9.2
"@welldone-software/why-did-you-render": ^8.0.1
autoprefixer: ^10.4.16 autoprefixer: ^10.4.16
classnames: ^2.3.2 classnames: ^2.3.2
comlink: ^4.4.1 comlink: ^4.4.1
@ -3080,7 +3081,6 @@ __metadata:
"@types/node": ^20.5.9 "@types/node": ^20.5.9
"@types/uuid": ^9.0.2 "@types/uuid": ^9.0.2
"@types/ws": ^8.5.5 "@types/ws": ^8.5.5
"@welldone-software/why-did-you-render": ^8.0.1
debug: ^4.3.4 debug: ^4.3.4
eventemitter3: ^5.0.1 eventemitter3: ^5.0.1
isomorphic-ws: ^5.0.0 isomorphic-ws: ^5.0.0