diff --git a/src/components/Note/MentionedUserLink/MentionedUserLink.tsx b/src/components/Note/MentionedUserLink/MentionedUserLink.tsx index fb8899f..ae84918 100644 --- a/src/components/Note/MentionedUserLink/MentionedUserLink.tsx +++ b/src/components/Note/MentionedUserLink/MentionedUserLink.tsx @@ -10,6 +10,7 @@ import styles from "./MentionedUserLink.module.scss"; const MentionedUserLink: Component<{ user: PrimalUser, + npub?: string, openInNewTab?: boolean, id?: string, }> = (props) => { @@ -39,7 +40,7 @@ const MentionedUserLink: Component<{ return {p.children} ; diff --git a/src/components/ProfileAbout/ProfileAbout.tsx b/src/components/ProfileAbout/ProfileAbout.tsx index f4cffa5..f0aa555 100644 --- a/src/components/ProfileAbout/ProfileAbout.tsx +++ b/src/components/ProfileAbout/ProfileAbout.tsx @@ -1,7 +1,7 @@ import { A } from '@solidjs/router'; import { nip19 } from 'nostr-tools'; -import { Component, createEffect, For, JSXElement, Show } from 'solid-js'; -import { createStore } from 'solid-js/store'; +import { Component, createEffect, For, JSXElement, onCleanup, Show } from 'solid-js'; +import { createStore, reconcile } from 'solid-js/store'; import { APP_ID } from '../../App'; import { linebreakRegex, urlExtractRegex, specialCharsRegex, hashtagCharsRegex, profileRegexG, Kind } from '../../constants'; import { hexToNpub, npubToHex } from '../../lib/keys'; @@ -179,8 +179,8 @@ const ProfileAbout: Component<{about: string | undefined }> = (props) => { const label = user ? userName(user) : truncateNpub(npub); return !user ? - <>@{label}{end} : - <>{MentionedUserLink({ user })}{end}; + <>@{label}{end} : + <>{MentionedUserLink({ user, npub })}{end}; } catch (e) { return {token}; } @@ -260,17 +260,17 @@ const ProfileAbout: Component<{about: string | undefined }> = (props) => { }); getUserProfiles(userMentions, subId); - - // const a = linkifyNostrNoteLink(linkifyNostrProfileLink(urlify(sanitize(about), () => '', false, false, true))); - - // setRenderProfileAbout(a) }; createEffect(() => { if (props.about && props.about.length > 0) { + setAboutContent([]); + setAboutTokens([]); + setUsersMentionedInAbout(reconcile({})); parseForMentions(props.about); } }); + return ( 0}>