Skip to content

Commit

Permalink
Update copy text
Browse files Browse the repository at this point in the history
  • Loading branch information
ksharma-xyz committed Nov 12, 2024
1 parent 163526c commit dbf1578
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package xyz.ksharma.krail.trip.planner.ui.savedtrips
import androidx.activity.ComponentActivity
import androidx.activity.SystemBarStyle
import androidx.activity.enableEdgeToEdge
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand All @@ -30,6 +29,7 @@ import xyz.ksharma.krail.design.system.components.Text
import xyz.ksharma.krail.design.system.components.TitleBar
import xyz.ksharma.krail.design.system.theme.KrailTheme
import xyz.ksharma.krail.trip.planner.ui.R
import xyz.ksharma.krail.trip.planner.ui.components.ErrorMessage
import xyz.ksharma.krail.trip.planner.ui.components.SavedTripCard
import xyz.ksharma.krail.trip.planner.ui.components.SearchStopRow
import xyz.ksharma.krail.trip.planner.ui.components.hexToComposeColor
Expand Down Expand Up @@ -82,33 +82,46 @@ fun SavedTripsScreen(
Spacer(modifier = Modifier.height(12.dp))
}

items(
items = savedTripsState.savedTrips,
key = { it.fromStopId + it.toStopId },
) { trip ->
if (savedTripsState.savedTrips.isEmpty()) {
item(key = "empty_state") {
ErrorMessage(
emoji = "🌟",
title = "Ready to roll, mate?",
message = "Star your fave trips and they'll be right here!",
modifier = Modifier
.padding(horizontal = 16.dp)
.animateItem(),
)
}
} else {
items(
items = savedTripsState.savedTrips,
key = { it.fromStopId + it.toStopId },
) { trip ->

SavedTripCard(
trip = trip,
onStarClick = { onEvent(SavedTripUiEvent.DeleteSavedTrip(trip)) },
onCardClick = {
onSearchButtonClick(
StopItem(
stopId = trip.fromStopId,
stopName = trip.fromStopName,
),
StopItem(
stopId = trip.toStopId,
stopName = trip.toStopName,
),
)
},
primaryTransportMode = null, // TODO
modifier = Modifier
.padding(horizontal = 16.dp)
.animateItem(fadeOutSpec = tween(durationMillis = 500)),
)
SavedTripCard(
trip = trip,
onStarClick = { onEvent(SavedTripUiEvent.DeleteSavedTrip(trip)) },
onCardClick = {
onSearchButtonClick(
StopItem(
stopId = trip.fromStopId,
stopName = trip.fromStopName,
),
StopItem(
stopId = trip.toStopId,
stopName = trip.toStopName,
),
)
},
primaryTransportMode = null, // TODO
modifier = Modifier
.padding(horizontal = 16.dp)
.animateItem(),
)

Spacer(modifier = Modifier.height(12.dp))
Spacer(modifier = Modifier.height(12.dp))
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import kotlinx.collections.immutable.ImmutableSet
Expand Down Expand Up @@ -74,9 +74,21 @@ fun UsualRideScreen(
LazyColumn(contentPadding = PaddingValues(top = 24.dp, bottom = 152.dp)) {
item {
Text(
text = "What's your usual ride mate?",
text = "Let's set the vibe.",
style = KrailTheme.typography.headlineLarge.copy(fontWeight = FontWeight.Normal),
modifier = Modifier.padding(horizontal = 24.dp, vertical = 16.dp),
modifier = Modifier
.padding(horizontal = 24.dp)
.padding(bottom = 8.dp, top = 16.dp),
)
}

item {
Text(
text = "What's your favourite color, mate?",
style = KrailTheme.typography.bodyMedium,
modifier = Modifier
.padding(horizontal = 24.dp)
.padding(bottom = 16.dp),
)
}

Expand All @@ -92,7 +104,7 @@ fun UsualRideScreen(
}

Text(
text = if (selectedProductClass != null) "Let's Go, Yeah!" else "Let's Go",
text = if (selectedProductClass != null) "Let's Go, Yeah!" else "Pick one.",
modifier = Modifier
.fillMaxWidth()
.clip(RoundedCornerShape(topStart = 24.dp, topEnd = 24.dp))
Expand Down Expand Up @@ -168,7 +180,7 @@ private fun TransportModeRadioButton(
}
}

@Preview
@PreviewLightDark
@Composable
private fun PreviewUsualRideScreen() {
KrailTheme {
Expand Down

0 comments on commit dbf1578

Please sign in to comment.