mirror of
https://github.com/t4t5/nostr-react.git
synced 2025-07-04 12:10:35 +02:00
Update README
This commit is contained in:
@ -60,7 +60,7 @@ const GlobalFeed = () => {
|
|||||||
**Fetching all `text_note` events from a specific user, since the beginning of time:**
|
**Fetching all `text_note` events from a specific user, since the beginning of time:**
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
import { useNostrEvents, dateToUnix } from "nostr-react";
|
import { useNostrEvents } from "nostr-react";
|
||||||
|
|
||||||
const ProfileFeed = () => {
|
const ProfileFeed = () => {
|
||||||
const { events } = useNostrEvents({
|
const { events } = useNostrEvents({
|
||||||
@ -86,7 +86,7 @@ const ProfileFeed = () => {
|
|||||||
**Post a message:**
|
**Post a message:**
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
import { useNostr } from "nostr-react";
|
import { useNostr, dateToUnix } from "nostr-react";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
type Event as NostrEvent,
|
type Event as NostrEvent,
|
||||||
@ -117,7 +117,7 @@ export default function PostButton() {
|
|||||||
content: message,
|
content: message,
|
||||||
kind: 1,
|
kind: 1,
|
||||||
tags: [],
|
tags: [],
|
||||||
created_at: Math.floor(Date.now() / 1000),
|
created_at: dateToUnix(),
|
||||||
pubkey: getPublicKey(privKey),
|
pubkey: getPublicKey(privKey),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user