mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-10-01 17:31:13 +00:00
Fix links from profile about
This commit is contained in:
parent
8f5cd3b728
commit
e10728f1c7
@ -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 <A
|
||||
id={props.id}
|
||||
class={styles.userMention}
|
||||
href={`/p/${props.user.npub}`}
|
||||
href={`/p/${props.user.npub || props.npub}`}
|
||||
>
|
||||
{p.children}
|
||||
</A>;
|
||||
|
@ -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';
|
||||
@ -180,7 +180,7 @@ const ProfileAbout: Component<{about: string | undefined }> = (props) => {
|
||||
|
||||
return !user ?
|
||||
<><A href={path}>@{label}</A>{end}</> :
|
||||
<>{MentionedUserLink({ user })}{end}</>;
|
||||
<>{MentionedUserLink({ user, npub })}{end}</>;
|
||||
} catch (e) {
|
||||
return <span class={styles.error}> {token}</span>;
|
||||
}
|
||||
@ -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 (
|
||||
<Show when={aboutContent.length > 0}>
|
||||
<div class={styles.profileAbout}>
|
||||
|
Loading…
Reference in New Issue
Block a user