replace all nostr-react useProfile with NDK useProfileValue

This commit is contained in:
2025-05-04 23:25:24 +02:00
parent ec4e6f2712
commit 048a721b65
22 changed files with 56 additions and 67 deletions

View File

@@ -5,12 +5,11 @@ import {
nip19,
} from "nostr-tools";
import Link from "next/link";
import { useProfileValue } from "@nostr-dev-kit/ndk-hooks";
export function RecentFollower({ follower }: { follower: any }) {
const { data: userData, isLoading: userDataLoading } = useProfile({
pubkey: follower.pubkey,
});
const userData = useProfileValue(follower.pubkey);
let encoded = nip19.npubEncode(follower.pubkey);
let parts = encoded.split('npub');

View File

@@ -5,6 +5,7 @@ import {
nip19,
} from "nostr-tools";
import Link from "next/link";
import { useProfileValue } from "@nostr-dev-kit/ndk-hooks";
export function RecentZap({ zap }: { zap: any }) {
@@ -15,9 +16,7 @@ export function RecentZap({ zap }: { zap: any }) {
}
}
const { data: userData, isLoading: userDataLoading } = useProfile({
pubkey: zapperPubkey,
});
const userData = useProfileValue(zapperPubkey);
console.log('zap', zap)

View File

@@ -10,15 +10,14 @@ import {
nip19,
} from "nostr-tools";
import { RecentZapsCard } from './RecentZapsCard';
import { useProfileValue } from '@nostr-dev-kit/ndk-hooks';
interface ProfileInfoCardProps {
pubkey: string;
}
const ProfileInfoCard: React.FC<ProfileInfoCardProps> = ({ pubkey }) => {
const { data: userData, isLoading: userDataLoading } = useProfile({
pubkey,
});
const userData = useProfileValue(pubkey);
const { events: followers, isLoading: followersLoading } = useNostrEvents({
filter: {