From 6c049001f6cf9d04f8b7777ce9ba6b59c5c4b599 Mon Sep 17 00:00:00 2001 From: codytseng Date: Sat, 1 Feb 2025 14:23:36 +0800 Subject: [PATCH] feat: display website link in profile --- src/lib/event.ts | 1 + src/pages/secondary/ProfilePage/index.tsx | 11 ++++++++++- src/types.ts | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib/event.ts b/src/lib/event.ts index b2fe821..da73606 100644 --- a/src/lib/event.ts +++ b/src/lib/event.ts @@ -119,6 +119,7 @@ export function getProfileFromProfileEvent(event: Event) { original_username: username, nip05: profileObj.nip05, about: profileObj.about, + website: profileObj.website, created_at: event.created_at } } catch (err) { diff --git a/src/pages/secondary/ProfilePage/index.tsx b/src/pages/secondary/ProfilePage/index.tsx index 421f026..1fbee19 100644 --- a/src/pages/secondary/ProfilePage/index.tsx +++ b/src/pages/secondary/ProfilePage/index.tsx @@ -28,6 +28,7 @@ import { useNostr } from '@/providers/NostrProvider' import { forwardRef, useMemo } from 'react' import { useTranslation } from 'react-i18next' import NotFoundPage from '../NotFoundPage' +import { Globe, Link } from 'lucide-react' const ProfilePage = forwardRef(({ id, index }: { id?: string; index?: number }, ref) => { const { t } = useTranslation() @@ -73,7 +74,7 @@ const ProfilePage = forwardRef(({ id, index }: { id?: string; index?: number }, } if (!profile) return - const { banner, username, about, avatar, pubkey } = profile + const { banner, username, about, avatar, pubkey, website } = profile return (
@@ -117,6 +118,14 @@ const ProfilePage = forwardRef(({ id, index }: { id?: string; index?: number },
+ {website && ( +
+ + + {website} + +
+ )}