mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-09 15:07:10 +02:00
ui: compact view tweaks
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 }}
|
||||
/>
|
||||
|
||||
@@ -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 || ""}
|
||||
|
||||
Reference in New Issue
Block a user