This commit is contained in:
2023-09-19 10:01:13 +01:00
parent 04239123bb
commit 4b2161369d
12 changed files with 42 additions and 65 deletions

View File

@ -25,8 +25,8 @@ import useLogin from "Hooks/useLogin";
type Cols = "notes" | "articles" | "media" | "streams" | "notifications";
interface DeckScope {
thread?: NostrLink,
setThread: (e?: NostrLink) => void
thread?: NostrLink;
setThread: (e?: NostrLink) => void;
}
export const DeckContext = createContext<DeckScope | undefined>(undefined);
@ -35,7 +35,7 @@ export function SnortDeckLayout() {
const login = useLogin();
const navigate = useNavigate();
const [deckScope, setDeckScope] = useState<DeckScope>({
setThread: (e?: NostrLink) => setDeckScope(s => ({ ...s, thread: e }))
setThread: (e?: NostrLink) => setDeckScope(s => ({ ...s, thread: e })),
});
useLoginFeed();

View File

@ -1,14 +1,6 @@
import "./Notifications.css";
import { useEffect, useMemo, useSyncExternalStore } from "react";
import {
EventExt,
EventKind,
NostrEvent,
NostrLink,
NostrPrefix,
TaggedNostrEvent,
parseZap,
} from "@snort/system";
import { EventExt, EventKind, NostrEvent, NostrLink, NostrPrefix, TaggedNostrEvent, parseZap } from "@snort/system";
import { unwrap } from "@snort/shared";
import { useUserProfile } from "@snort/system-react";
import { useInView } from "react-intersection-observer";

View File

@ -142,9 +142,16 @@ export const NotesTab = () => {
<>
<FollowsHint />
<TaskList />
<TimelineFollows postsOnly={true} noteOnClick={deckContext ? (ev) => {
deckContext.setThread(NostrLink.fromEvent(ev));
} : undefined} />
<TimelineFollows
postsOnly={true}
noteOnClick={
deckContext
? ev => {
deckContext.setThread(NostrLink.fromEvent(ev));
}
: undefined
}
/>
</>
);
};