ui: compact view tweaks

This commit is contained in:
Alejandro Gómez
2025-12-21 21:19:31 +01:00
parent 6481f1e04f
commit 64212121bd
5 changed files with 9 additions and 11 deletions

View File

@@ -141,6 +141,7 @@ export function WindowRenderer({ window, onClose }: WindowRendererProps) {
filter={window.props.filter}
relays={window.props.relays}
closeOnEose={window.props.closeOnEose}
view={window.props.view}
nip05Authors={window.props.nip05Authors}
nip05PTags={window.props.nip05PTags}
needsAccount={window.props.needsAccount}

View File

@@ -1,6 +1,5 @@
import type { NostrEvent } from "@/types/nostr";
import { useMemo } from "react";
import { Repeat2 } from "lucide-react";
import { getTagValue } from "applesauce-core/helpers";
import { useNostrEvent } from "@/hooks/useNostrEvent";
import { getContentPreview } from "./index";
@@ -43,7 +42,6 @@ export function GenericRepostCompactPreview({ event }: { event: NostrEvent }) {
return (
<span className="flex items-center gap-1 text-sm text-muted-foreground truncate">
<Repeat2 className="size-3 shrink-0" />
{kindLabel && (
<span className="shrink-0 text-xs opacity-70">{kindLabel}</span>
)}

View File

@@ -126,8 +126,8 @@ export function ReactionCompactPreview({ event }: { event: NostrEvent }) {
<UserName pubkey={reactedEvent.pubkey} className="text-sm shrink-0" />
<span className="text-muted-foreground truncate">
<RichText
content={preview || ""}
className="inline text-sm leading-none"
event={reactedEvent}
className="inline text-sm truncate line-clamp-1 leading-none"
options={{ showMedia: false, showEventEmbeds: false }}
/>
</span>

View File

@@ -28,21 +28,17 @@ export function RepostCompactPreview({ event }: { event: NostrEvent }) {
// Fetch the reposted event
const repostedEvent = useNostrEvent(eventPointer);
// Get content preview
const preview = repostedEvent ? getContentPreview(repostedEvent, 50) : null;
return (
<span className="flex items-center gap-1 text-sm text-muted-foreground truncate">
<Repeat2 className="size-3 shrink-0" />
{repostedEvent ? (
<>
<UserName
pubkey={repostedEvent.pubkey}
className="text-sm shrink-0"
/>
<span className="truncate">
<span className="truncate line-clamp-1">
<RichText
content={preview || ""}
event={repostedEvent}
className="inline text-sm leading-none"
options={{ showMedia: false, showEventEmbeds: false }}
/>

View File

@@ -61,7 +61,10 @@ export function ZapCompactPreview({ event }: { event: NostrEvent }) {
)}
{zappedEvent && (
<>
<UserName pubkey={zappedEvent.pubkey} className="text-sm shrink-0" />
<UserName
pubkey={zappedEvent.pubkey}
className="text-sm truncate line-clamp-1"
/>
<span className="text-muted-foreground truncate">
<RichText
content={preview || ""}