This commit is contained in:
Shusui MOYATANI
2023-03-27 00:53:19 +09:00
parent 567e1f8df8
commit 3e52a24f87
7 changed files with 60 additions and 25 deletions

View File

@@ -27,7 +27,7 @@ const TextNoteContentDisplay = (props: TextNoteContentDisplayProps) => {
return <PlainTextDisplay plainText={item} />;
}
if (item.type === 'MentionedUser') {
return <MentionedUserDisplay mentionedUser={item} />;
return <MentionedUserDisplay pubkey={item.pubkey} />;
}
if (item.type === 'MentionedEvent') {
if (props.embedding) {
@@ -43,6 +43,12 @@ const TextNoteContentDisplay = (props: TextNoteContentDisplayProps) => {
</div>
);
}
if (item.data.type === 'npub' && props.embedding) {
return <MentionedUserDisplay pubkey={item.data.data} />;
}
if (item.data.type === 'nprofile' && props.embedding) {
return <MentionedUserDisplay pubkey={item.data.data.pubkey} />;
}
return <span class="text-blue-500 underline">{item.content}</span>;
}
if (item.type === 'HashTag') {
@@ -61,6 +67,7 @@ const TextNoteContentDisplay = (props: TextNoteContentDisplayProps) => {
}
return <SafeLink class="text-blue-500 underline" href={item.content} />;
}
console.error('Not all ParsedTextNoteNodes are covered', item);
return null;
}}
</For>