Skip to content

Commit

Permalink
disable media and line breaks in trending notes
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalmi committed Nov 30, 2023
1 parent 468dc3b commit a4f691d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/app/src/Element/Trending/ShortNote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import { Link } from "react-router-dom";
import NoteTime from "@/Element/Event/NoteTime";

export default function ShortNote({ event }: { event: TaggedNostrEvent }) {
// replace newlines with spaces, replace double spaces with single spaces
const content = event.content.slice(0, 80).replace(/\n/g, " ").replace(/ +/g, " ");
return (
<Link to={`/${NostrLink.fromEvent(event).encode(CONFIG.eventLinkPrefix)}`} className="flex flex-col">
<div className="flex flex-row justify-between">
<ProfileImage pubkey={event.pubkey} size={32} showNip05={false} />
<NoteTime from={event.created_at * 1000} />
</div>
<div className="ml-10">
<Text {...event} truncate={75} />
<Text {...event} content={content} truncate={75} disableMedia={true} />
</div>
</Link>
);
Expand Down

0 comments on commit a4f691d

Please sign in to comment.