mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-06-06 02:31:13 +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}
|
filter={window.props.filter}
|
||||||
relays={window.props.relays}
|
relays={window.props.relays}
|
||||||
closeOnEose={window.props.closeOnEose}
|
closeOnEose={window.props.closeOnEose}
|
||||||
|
view={window.props.view}
|
||||||
nip05Authors={window.props.nip05Authors}
|
nip05Authors={window.props.nip05Authors}
|
||||||
nip05PTags={window.props.nip05PTags}
|
nip05PTags={window.props.nip05PTags}
|
||||||
needsAccount={window.props.needsAccount}
|
needsAccount={window.props.needsAccount}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import type { NostrEvent } from "@/types/nostr";
|
import type { NostrEvent } from "@/types/nostr";
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { Repeat2 } from "lucide-react";
|
|
||||||
import { getTagValue } from "applesauce-core/helpers";
|
import { getTagValue } from "applesauce-core/helpers";
|
||||||
import { useNostrEvent } from "@/hooks/useNostrEvent";
|
import { useNostrEvent } from "@/hooks/useNostrEvent";
|
||||||
import { getContentPreview } from "./index";
|
import { getContentPreview } from "./index";
|
||||||
@@ -43,7 +42,6 @@ export function GenericRepostCompactPreview({ event }: { event: NostrEvent }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<span className="flex items-center gap-1 text-sm text-muted-foreground truncate">
|
<span className="flex items-center gap-1 text-sm text-muted-foreground truncate">
|
||||||
<Repeat2 className="size-3 shrink-0" />
|
|
||||||
{kindLabel && (
|
{kindLabel && (
|
||||||
<span className="shrink-0 text-xs opacity-70">{kindLabel}</span>
|
<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" />
|
<UserName pubkey={reactedEvent.pubkey} className="text-sm shrink-0" />
|
||||||
<span className="text-muted-foreground truncate">
|
<span className="text-muted-foreground truncate">
|
||||||
<RichText
|
<RichText
|
||||||
content={preview || ""}
|
event={reactedEvent}
|
||||||
className="inline text-sm leading-none"
|
className="inline text-sm truncate line-clamp-1 leading-none"
|
||||||
options={{ showMedia: false, showEventEmbeds: false }}
|
options={{ showMedia: false, showEventEmbeds: false }}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -28,21 +28,17 @@ export function RepostCompactPreview({ event }: { event: NostrEvent }) {
|
|||||||
// Fetch the reposted event
|
// Fetch the reposted event
|
||||||
const repostedEvent = useNostrEvent(eventPointer);
|
const repostedEvent = useNostrEvent(eventPointer);
|
||||||
|
|
||||||
// Get content preview
|
|
||||||
const preview = repostedEvent ? getContentPreview(repostedEvent, 50) : null;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span className="flex items-center gap-1 text-sm text-muted-foreground truncate">
|
<span className="flex items-center gap-1 text-sm text-muted-foreground truncate">
|
||||||
<Repeat2 className="size-3 shrink-0" />
|
|
||||||
{repostedEvent ? (
|
{repostedEvent ? (
|
||||||
<>
|
<>
|
||||||
<UserName
|
<UserName
|
||||||
pubkey={repostedEvent.pubkey}
|
pubkey={repostedEvent.pubkey}
|
||||||
className="text-sm shrink-0"
|
className="text-sm shrink-0"
|
||||||
/>
|
/>
|
||||||
<span className="truncate">
|
<span className="truncate line-clamp-1">
|
||||||
<RichText
|
<RichText
|
||||||
content={preview || ""}
|
event={repostedEvent}
|
||||||
className="inline text-sm leading-none"
|
className="inline text-sm leading-none"
|
||||||
options={{ showMedia: false, showEventEmbeds: false }}
|
options={{ showMedia: false, showEventEmbeds: false }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -61,7 +61,10 @@ export function ZapCompactPreview({ event }: { event: NostrEvent }) {
|
|||||||
)}
|
)}
|
||||||
{zappedEvent && (
|
{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">
|
<span className="text-muted-foreground truncate">
|
||||||
<RichText
|
<RichText
|
||||||
content={preview || ""}
|
content={preview || ""}
|
||||||
|
|||||||
Reference in New Issue
Block a user