mirror of
https://git.v0l.io/Kieran/dtan.git
synced 2025-01-18 04:41:32 +00:00
fix: removed wrapping of text components for the description field
This commit is contained in:
parent
c9bd5ff983
commit
aa20bd1452
@ -3,7 +3,7 @@ import { useMemo } from "react";
|
||||
import { Mention } from "./mention";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
export function Text({ content, tags }: { content: string; tags: Array<Array<string>> }) {
|
||||
export function Text({ content, tags, wrap = true }: { content: string; tags: Array<Array<string>>; wrap?: boolean }) {
|
||||
const frags = useMemo(() => transformText(content, tags), [content, tags]);
|
||||
|
||||
function renderFrag(f: ParsedFragment, index: number) {
|
||||
@ -29,5 +29,8 @@ export function Text({ content, tags }: { content: string; tags: Array<Array<str
|
||||
}
|
||||
}
|
||||
|
||||
return <div className="text">{frags.map(renderFrag)}</div>;
|
||||
if (wrap) {
|
||||
return <div className="text">{frags.map(renderFrag)}</div>;
|
||||
}
|
||||
return frags.map(renderFrag);
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ export function TorrentDetail({ item }: { item: TaggedNostrEvent }) {
|
||||
<>
|
||||
<h3 className="mt-2">Description</h3>
|
||||
<pre className="font-mono text-sm bg-neutral-900 p-4 rounded-lg overflow-y-auto">
|
||||
<Text content={item.content} tags={item.tags}></Text>
|
||||
<Text content={item.content} tags={item.tags} wrap={false}></Text>
|
||||
</pre>
|
||||
</>
|
||||
)}
|
||||
|
Loading…
Reference in New Issue
Block a user