feat(date-memories): add date reflection nudge card to HomeScreen
This commit is contained in:
parent
c056f6a7a1
commit
5375ba90a8
|
|
@ -251,6 +251,7 @@ private fun HomeCallbacks.toActionHandler(onNavigate: (String) -> Unit): (HomeAc
|
||||||
HomeActionTarget.Challenge -> onNavigate(AppRoute.CONNECTION_CHALLENGES)
|
HomeActionTarget.Challenge -> onNavigate(AppRoute.CONNECTION_CHALLENGES)
|
||||||
HomeActionTarget.DatePlan -> onNavigate(AppRoute.DATE_MATCHES)
|
HomeActionTarget.DatePlan -> onNavigate(AppRoute.DATE_MATCHES)
|
||||||
HomeActionTarget.MemoryCapsule -> onNavigate(AppRoute.MEMORY_LANE)
|
HomeActionTarget.MemoryCapsule -> onNavigate(AppRoute.MEMORY_LANE)
|
||||||
|
HomeActionTarget.DateMemories -> onNavigate(AppRoute.DATE_MEMORIES)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -416,6 +417,7 @@ private fun homeActionGlyph(target: HomeActionTarget): Int = when (target) {
|
||||||
HomeActionTarget.Challenge -> R.drawable.glyph_connection_challenge
|
HomeActionTarget.Challenge -> R.drawable.glyph_connection_challenge
|
||||||
HomeActionTarget.DatePlan -> R.drawable.glyph_date_card_heart
|
HomeActionTarget.DatePlan -> R.drawable.glyph_date_card_heart
|
||||||
HomeActionTarget.MemoryCapsule -> R.drawable.glyph_memory_capsule
|
HomeActionTarget.MemoryCapsule -> R.drawable.glyph_memory_capsule
|
||||||
|
HomeActionTarget.DateMemories -> R.drawable.glyph_date_replay
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
|
@ -715,6 +717,16 @@ private fun PartnerQuickActionsSheet(
|
||||||
if (state.togetherSince > 0L) add("together since ${formatMonthYear(state.togetherSince)}")
|
if (state.togetherSince > 0L) add("together since ${formatMonthYear(state.togetherSince)}")
|
||||||
}.joinToString(" · ")
|
}.joinToString(" · ")
|
||||||
}
|
}
|
||||||
|
// Living "today" status — reflects where the couple is in the daily ritual. Hidden when there's no
|
||||||
|
// question assigned (no misleading "still open").
|
||||||
|
val todayStatus = state.dailyQuestion?.let {
|
||||||
|
when (state.dailyQuestionState) {
|
||||||
|
DailyQuestionState.BOTH_ANSWERED, DailyQuestionState.REVEALED -> "You've both answered today 💜"
|
||||||
|
DailyQuestionState.PARTNER_ANSWERED_USER_PENDING -> "They answered — your turn"
|
||||||
|
DailyQuestionState.USER_ANSWERED_PARTNER_PENDING -> "Waiting on their answer"
|
||||||
|
DailyQuestionState.UNANSWERED -> "Tonight's question is still open"
|
||||||
|
}
|
||||||
|
}
|
||||||
val openPartnerPage = { onNavigate(AppRoute.PARTNER_HOME); onDismiss() }
|
val openPartnerPage = { onNavigate(AppRoute.PARTNER_HOME); onDismiss() }
|
||||||
|
|
||||||
ModalBottomSheet(onDismissRequest = onDismiss, sheetState = sheetState) {
|
ModalBottomSheet(onDismissRequest = onDismiss, sheetState = sheetState) {
|
||||||
|
|
@ -757,26 +769,36 @@ private fun PartnerQuickActionsSheet(
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Ellipsis
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
todayStatus?.let {
|
||||||
|
Text(
|
||||||
|
text = it,
|
||||||
|
style = MaterialTheme.typography.bodySmall.copy(fontWeight = FontWeight.Medium),
|
||||||
|
color = MaterialTheme.colorScheme.primary,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Divider(modifier = Modifier.padding(vertical = 4.dp), thickness = 0.5.dp)
|
Divider(modifier = Modifier.padding(vertical = 4.dp), thickness = 0.5.dp)
|
||||||
|
|
||||||
PartnerSheetAction("💜", "Thinking of you", enabled = !state.isSendingNudge, onClick = onThinkingOfYou)
|
PartnerSheetAction(R.drawable.glyph_heart, "Thinking of you", enabled = !state.isSendingNudge, onClick = onThinkingOfYou)
|
||||||
PartnerSheetAction("💬", "Message") { onNavigate(AppRoute.MESSAGES); onDismiss() }
|
PartnerSheetAction(R.drawable.glyph_chat, "Message") { onNavigate(AppRoute.MESSAGES); onDismiss() }
|
||||||
PartnerSheetAction(
|
PartnerSheetAction(
|
||||||
"✨",
|
R.drawable.glyph_paired_cards,
|
||||||
"Together",
|
"Together",
|
||||||
trailing = state.unreadActivityCount.takeIf { it > 0 }?.let { if (it > 9) "9+" else "$it" }
|
trailing = state.unreadActivityCount.takeIf { it > 0 }?.let { if (it > 9) "9+" else "$it" }
|
||||||
) { onNavigate(AppRoute.ACTIVITY); onDismiss() }
|
) { onNavigate(AppRoute.ACTIVITY); onDismiss() }
|
||||||
PartnerSheetAction("⚙️", "Your relationship") { onNavigate(AppRoute.RELATIONSHIP_SETTINGS); onDismiss() }
|
PartnerSheetAction(R.drawable.glyph_memory_capsule, "Our memories") { onNavigate(AppRoute.MEMORY_LANE); onDismiss() }
|
||||||
|
PartnerSheetAction(R.drawable.glyph_settings, "Your relationship") { onNavigate(AppRoute.RELATIONSHIP_SETTINGS); onDismiss() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun PartnerSheetAction(
|
private fun PartnerSheetAction(
|
||||||
emoji: String,
|
@DrawableRes iconRes: Int,
|
||||||
label: String,
|
label: String,
|
||||||
enabled: Boolean = true,
|
enabled: Boolean = true,
|
||||||
trailing: String? = null,
|
trailing: String? = null,
|
||||||
|
|
@ -791,7 +813,12 @@ private fun PartnerSheetAction(
|
||||||
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
Text(text = emoji, style = MaterialTheme.typography.titleMedium)
|
HomeGlyphIcon(
|
||||||
|
resId = iconRes,
|
||||||
|
contentDescription = null,
|
||||||
|
tint = MaterialTheme.colorScheme.primary,
|
||||||
|
modifier = Modifier.size(22.dp)
|
||||||
|
)
|
||||||
Text(
|
Text(
|
||||||
text = label,
|
text = label,
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue