mirror of
https://github.com/lumina-rocks/lumina.git
synced 2026-06-06 18:51:16 +02:00
refactor: Rename renderTextWithLinkedTags to renderTextWithLinks for clarity and combine hashtag and nostr reference handling
This commit is contained in:
@@ -13,7 +13,7 @@ import type { Event as NostrEvent } from "nostr-tools"
|
||||
import ZapButton from "./ZapButton"
|
||||
import Image from "next/image"
|
||||
import CardOptionsDropdown from "./CardOptionsDropdown"
|
||||
import { renderTextWithLinkedTags } from "@/utils/textUtils"
|
||||
import { renderTextWithLinkedTags, renderTextWithLinks } from "@/utils/textUtils"
|
||||
|
||||
// Function to extract all images from a kind 20 event's imeta tags
|
||||
const extractImagesFromEvent = (tags: string[][]): string[] => {
|
||||
@@ -169,7 +169,7 @@ const KIND20Card: React.FC<KIND20CardProps> = ({
|
||||
)}
|
||||
</div>
|
||||
<div className="p-4">
|
||||
<div className="break-word overflow-hidden">{renderTextWithLinkedTags(text, tags)}</div>
|
||||
<div className="break-word overflow-hidden">{renderTextWithLinks(text, tags, { [pubkey]: userData || {} })}</div>
|
||||
<hr className="my-4" />
|
||||
<div className="space-x-4 flex justify-between items-start">
|
||||
<div className="flex space-x-4">
|
||||
|
||||
@@ -30,7 +30,7 @@ import Link from 'next/link';
|
||||
import { Event as NostrEvent } from "nostr-tools";
|
||||
import ZapButton from './ZapButton';
|
||||
import CardOptionsDropdown from './CardOptionsDropdown';
|
||||
import { renderTextWithLinkedTags } from '@/utils/textUtils';
|
||||
import { renderTextWithLinkedTags, renderTextWithLinks } from '@/utils/textUtils';
|
||||
|
||||
interface NoteCardProps {
|
||||
pubkey: string;
|
||||
@@ -143,7 +143,7 @@ const NoteCard: React.FC<NoteCardProps> = ({ pubkey, text, eventId, tags, event,
|
||||
}
|
||||
<br />
|
||||
<div className='break-word overflow-hidden'>
|
||||
{renderTextWithLinkedTags(textWithoutImage, tags)}
|
||||
{renderTextWithLinks(textWithoutImage, tags, { [pubkey]: userData || {} })}
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
Reference in New Issue
Block a user