From fec2f2dfc8a1b1b7cadc1d180940ef28afa4e474 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Mar 2026 12:26:42 +0000 Subject: [PATCH] feat: add @Preview functions for RenderCalendarTimeSlotEvent and RenderCalendarDateSlotEvent --- .../amethyst/ui/note/types/CalendarEvent.kt | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/CalendarEvent.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/CalendarEvent.kt index 188378c49..639aa5310 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/CalendarEvent.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/CalendarEvent.kt @@ -34,6 +34,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.model.Note @@ -44,6 +45,7 @@ import com.vitorpamplona.amethyst.ui.note.elements.DefaultImageHeaderBackground import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.stringRes import com.vitorpamplona.amethyst.ui.theme.StdVertSpacer +import com.vitorpamplona.amethyst.ui.theme.ThemeComparisonColumn import com.vitorpamplona.amethyst.ui.theme.replyModifier import com.vitorpamplona.quartz.nip52Calendar.appt.day.CalendarDateSlotEvent import com.vitorpamplona.quartz.nip52Calendar.appt.time.CalendarTimeSlotEvent @@ -228,3 +230,31 @@ private fun formatDateRange( start } } + +@Composable +@Preview +fun RenderCalendarTimeSlotEventPreview() { + ThemeComparisonColumn { + CalendarHeader( + title = "Nostr Developer Meetup", + image = null, + summary = "Join us for an evening of lightning talks and open discussion on the latest Nostr protocol developments.", + location = "Berlin, Germany", + dateRange = "Mar 15, 2025, 7:00 PM – 10:00 PM", + ) + } +} + +@Composable +@Preview +fun RenderCalendarDateSlotEventPreview() { + ThemeComparisonColumn { + CalendarHeader( + title = "Bitcoin Conference 2025", + image = null, + summary = null, + location = null, + dateRange = "2025-05-01 – 2025-05-03", + ) + } +}