This commit is contained in:
Ren Amamiya
2023-03-24 14:59:01 +07:00
parent e2fa8cbe03
commit c1f06f8b28
29 changed files with 179 additions and 229 deletions

View File

@@ -1,20 +1,22 @@
import { RelayContext } from '@components/contexts/relay';
import { Content } from '@components/note/content';
import { RelayContext } from '@components/relaysProvider';
import useLocalStorage from '@rehooks/local-storage';
import { relaysAtom } from '@stores/relays';
import { useAtomValue } from 'jotai';
import { Author } from 'nostr-relaypool';
import { useContext, useEffect, useState } from 'react';
export default function ProfileNotes({ id }: { id: string }) {
const relayPool: any = useContext(RelayContext);
const [relays]: any = useLocalStorage('relays');
const pool: any = useContext(RelayContext);
const relays: any = useAtomValue(relaysAtom);
const [data, setData] = useState([]);
useEffect(() => {
const user = new Author(relayPool, relays, id);
const user = new Author(pool, relays, id);
user.text((res) => setData((data) => [...data, res]), 0, 100);
}, [id, relayPool, relays]);
}, [id, pool, relays]);
return (
<div className="flex flex-col">