From ca162a0610ed299d29b93b0cb617562084a53730 Mon Sep 17 00:00:00 2001 From: Karan Sharma <55722391+ksharma-xyz@users.noreply.github.com> Date: Sun, 20 Oct 2024 02:33:14 +1100 Subject: [PATCH] Add previews for JourneyLeg --- .../trip_planner/ui/components/JourneyLeg.kt | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/feature/trip-planner/ui/src/main/kotlin/xyz/ksharma/krail/trip_planner/ui/components/JourneyLeg.kt b/feature/trip-planner/ui/src/main/kotlin/xyz/ksharma/krail/trip_planner/ui/components/JourneyLeg.kt index 32769513..1b0efbdf 100644 --- a/feature/trip-planner/ui/src/main/kotlin/xyz/ksharma/krail/trip_planner/ui/components/JourneyLeg.kt +++ b/feature/trip-planner/ui/src/main/kotlin/xyz/ksharma/krail/trip_planner/ui/components/JourneyLeg.kt @@ -130,7 +130,7 @@ fun JourneyLeg( @PreviewLightDark @Preview(fontScale = 2f) @Composable -private fun PreviewJourneyLeg() { +private fun PreviewJourneyLegBus() { KrailTheme { JourneyLeg( transportModeLine = TransportModeLine( @@ -144,3 +144,38 @@ private fun PreviewJourneyLeg() { ) } } + + +@PreviewLightDark +@Composable +private fun PreviewJourneyLegTrain() { + KrailTheme { + JourneyLeg( + transportModeLine = TransportModeLine( + transportMode = TransportMode.Train(), + lineName = "T2", + ), + stopsInfo = "2 stops (1h 10mins)", + departureTime = "8:25am", + stopName = "Central Station", + isWheelchairAccessible = true, + ) + } +} + +@PreviewLightDark +@Composable +private fun PreviewJourneyLegMetro() { + KrailTheme { + JourneyLeg( + transportModeLine = TransportModeLine( + transportMode = TransportMode.Metro(), + lineName = "M1", + ), + stopsInfo = "2 stops (1h 10mins)", + departureTime = "8:25am", + stopName = "Central Station", + isWheelchairAccessible = true, + ) + } +}