mirror of
https://github.com/lumina-rocks/lumina.git
synced 2026-06-05 02:01:47 +02:00
replace all nostr-react useProfile with NDK useProfileValue
This commit is contained in:
@@ -15,14 +15,14 @@ import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar"
|
||||
import { useProfile } from "nostr-react"
|
||||
import Link from "next/link"
|
||||
import { nip19 } from "nostr-tools"
|
||||
import { useProfileValue } from "@nostr-dev-kit/ndk-hooks"
|
||||
|
||||
export function AvatarDropdown() {
|
||||
let pubkey = window.localStorage.getItem('pubkey');
|
||||
let pubkeyEncoded = pubkey ? nip19.npubEncode(pubkey) : pubkey;
|
||||
let src = "https://robohash.org/" + (pubkey as string);
|
||||
const { data: userData } = useProfile({
|
||||
pubkey: pubkey as string,
|
||||
});
|
||||
const userData = useProfileValue(pubkey as string);
|
||||
|
||||
if (pubkey !== null) {
|
||||
src = userData?.picture || "https://robohash.org/" + pubkey;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user