add ndk provider

This commit is contained in:
Ren Amamiya
2023-07-09 07:21:41 +07:00
parent 0109ec28c4
commit 24807b2758
26 changed files with 178 additions and 106 deletions

View File

@@ -1,15 +1,15 @@
import { NDKFilter } from '@nostr-dev-kit/ndk';
import { useQuery } from '@tanstack/react-query';
import { useContext } from 'react';
import { useNDK } from '@libs/ndk/provider';
import { Note } from '@shared/notes/note';
import { RelayContext } from '@shared/relayProvider';
import { dateToUnix, getHourAgo } from '@utils/date';
import { LumeEvent } from '@utils/types';
export function UserFeed({ pubkey }: { pubkey: string }) {
const ndk = useContext(RelayContext);
const { ndk } = useNDK();
const { status, data } = useQuery(['user-feed', pubkey], async () => {
const now = new Date();
const filter: NDKFilter = {