mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-13 17:07:27 +02:00
feat: enhance zap display with RichText context and scrollable details
Improvements: - Pass zap request event as context to RichText components - Enables proper mention/link resolution in zap messages - Supports interactive elements (mentions, hashtags, links) - Provides full event context for rendering - Make transaction detail dialog scrollable - Add max-h-[90vh] to DialogContent with flex layout - Wrap content in overflow-y-auto container with max-h-[calc(90vh-8rem)] - Prevents dialog overflow when displaying large zapped posts - Smooth scrolling for long zap message threads - Reduce transaction page size from 20 to 10 - Better performance with rich zap rendering - Faster initial load and scroll rendering - Reduces memory footprint for transaction list Technical changes: - Add zapRequestEvent field to ZapRequestInfo interface - Pass zapRequestEvent to all RichText components rendering zap messages - Update BATCH_SIZE constant from 20 to 10 - Add flex layout to DialogContent for proper scrolling - Add pr-2 padding to scrollable container for visual spacing
This commit is contained in:
@@ -91,7 +91,7 @@ interface InvoiceDetails {
|
||||
expiry?: number;
|
||||
}
|
||||
|
||||
const BATCH_SIZE = 20;
|
||||
const BATCH_SIZE = 10; // Smaller pages for better performance with zap rendering
|
||||
const PAYMENT_CHECK_INTERVAL = 5000; // Check every 5 seconds
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,7 @@ export interface ZapRequestInfo {
|
||||
zappedEventId?: string; // ID of the zapped event (from e tag)
|
||||
zappedEventAddress?: string; // Address of the zapped event (from a tag)
|
||||
amount?: number; // amount in sats (if available)
|
||||
zapRequestEvent: NostrEvent; // The full kind 9734 zap request event
|
||||
}
|
||||
|
||||
// Symbol for caching parsed zap requests on transaction objects
|
||||
@@ -79,6 +80,7 @@ export function parseZapRequest(transaction: {
|
||||
message: event.content || "",
|
||||
zappedEventId,
|
||||
zappedEventAddress,
|
||||
zapRequestEvent: event,
|
||||
};
|
||||
} catch {
|
||||
// Not JSON or parsing failed - not a zap request
|
||||
|
||||
Reference in New Issue
Block a user