mirror of
https://github.com/luminous-devs/lume.git
synced 2024-10-02 18:00:47 +00:00
update
This commit is contained in:
parent
31a53b9c48
commit
24b21a9451
@ -21,8 +21,8 @@ export function UserProfile({ pubkey }: { pubkey: string }) {
|
|||||||
const { user } = useProfile(pubkey);
|
const { user } = useProfile(pubkey);
|
||||||
|
|
||||||
const [followed, setFollowed] = useState(false);
|
const [followed, setFollowed] = useState(false);
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
|
const navigate = useNavigate();
|
||||||
const svgURI =
|
const svgURI =
|
||||||
'data:image/svg+xml;utf8,' + encodeURIComponent(minidenticon(pubkey, 90, 50));
|
'data:image/svg+xml;utf8,' + encodeURIComponent(minidenticon(pubkey, 90, 50));
|
||||||
|
|
||||||
@ -78,9 +78,9 @@ export function UserProfile({ pubkey }: { pubkey: string }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="h-56 w-full overflow-hidden rounded-tl-lg">
|
<div className="h-56 w-full overflow-hidden rounded-tl-lg">
|
||||||
{user.banner ? (
|
{user?.banner ? (
|
||||||
<img
|
<img
|
||||||
src={user.banner}
|
src={user?.banner}
|
||||||
alt="user banner"
|
alt="user banner"
|
||||||
className="h-full w-full rounded-tl-lg object-cover"
|
className="h-full w-full rounded-tl-lg object-cover"
|
||||||
/>
|
/>
|
||||||
@ -112,10 +112,10 @@ export function UserProfile({ pubkey }: { pubkey: string }) {
|
|||||||
<h5 className="text-center text-xl font-semibold text-neutral-900 dark:text-neutral-100">
|
<h5 className="text-center text-xl font-semibold text-neutral-900 dark:text-neutral-100">
|
||||||
{user.name || user.display_name || user.displayName || 'No name'}
|
{user.name || user.display_name || user.displayName || 'No name'}
|
||||||
</h5>
|
</h5>
|
||||||
{user.nip05 ? (
|
{user?.nip05 ? (
|
||||||
<NIP05
|
<NIP05
|
||||||
pubkey={pubkey}
|
pubkey={pubkey}
|
||||||
nip05={user?.nip05}
|
nip05={user.nip05}
|
||||||
className="text-neutral-600 dark:text-neutral-400"
|
className="text-neutral-600 dark:text-neutral-400"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
@ -125,7 +125,7 @@ export function UserProfile({ pubkey }: { pubkey: string }) {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col gap-6">
|
<div className="flex flex-col gap-6">
|
||||||
{user.about || user.bio ? (
|
{user?.about || user?.bio ? (
|
||||||
<p className="mt-2 max-w-[500px] select-text break-words text-center text-neutral-900 dark:text-neutral-100">
|
<p className="mt-2 max-w-[500px] select-text break-words text-center text-neutral-900 dark:text-neutral-100">
|
||||||
{user.about || user.bio}
|
{user.about || user.bio}
|
||||||
</p>
|
</p>
|
||||||
|
@ -39,7 +39,6 @@ export const NIP05 = memo(function NIP05({
|
|||||||
if (!res.ok) throw new Error(`Failed to fetch NIP-05 service: ${nip05}`);
|
if (!res.ok) throw new Error(`Failed to fetch NIP-05 service: ${nip05}`);
|
||||||
|
|
||||||
const data: NIP05 = await res.json();
|
const data: NIP05 = await res.json();
|
||||||
|
|
||||||
if (data.names) {
|
if (data.names) {
|
||||||
if (data.names[localPath] !== pubkey) return false;
|
if (data.names[localPath] !== pubkey) return false;
|
||||||
return true;
|
return true;
|
||||||
|
@ -222,7 +222,7 @@ export const User = memo(function User({
|
|||||||
{user?.name || user?.display_name || user?.displayName}
|
{user?.name || user?.display_name || user?.displayName}
|
||||||
</h3>
|
</h3>
|
||||||
<p className="max-w-[10rem] truncate text-sm text-neutral-900 dark:text-neutral-100/70">
|
<p className="max-w-[10rem] truncate text-sm text-neutral-900 dark:text-neutral-100/70">
|
||||||
{user?.nip05 || user?.username || displayNpub(pubkey, 16)}
|
{user?.username || displayNpub(pubkey, 16)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -551,7 +551,7 @@ export const User = memo(function User({
|
|||||||
{user?.nip05 ? (
|
{user?.nip05 ? (
|
||||||
<NIP05
|
<NIP05
|
||||||
pubkey={pubkey}
|
pubkey={pubkey}
|
||||||
nip05={user?.nip05}
|
nip05={user.nip05}
|
||||||
className="max-w-[15rem] truncate text-sm text-neutral-500 dark:text-neutral-300"
|
className="max-w-[15rem] truncate text-sm text-neutral-500 dark:text-neutral-300"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
Loading…
Reference in New Issue
Block a user