fix(folio): move balance into the header, one compact line under the account name

This commit is contained in:
pj committed 2026-07-13 14:21:38 +05:30
1 parent 00a651b612
commit cb480d5b28
2 files changed
+10 -7

No files matched your search

@@ -68,6 +68,14 @@ fun AddTransactionScreen(state: AddTransactionUiState, onEvent: (AddTransactionE
Header(
title = "Add transaction",
subtitle = account.name,
detail = {
Text(
"Balance: ${formatCents(state.balanceCents)}",
style = Type.caption,
color = LocalTokens.current.textMuted,
modifier = Modifier.testTag("TxnCurrentBalance"),
)
},
left = { BackButton { onEvent(AddTransactionEvent.Back) } },
)
},
@@ -81,17 +89,10 @@ fun AddTransactionScreen(state: AddTransactionUiState, onEvent: (AddTransactionE
)
},
) {
val t = LocalTokens.current
Column(
modifier = Modifier.fillMaxWidth().padding(vertical = 8.dp),
verticalArrangement = Arrangement.spacedBy(16.dp),
) {
Text(
"Balance: ${formatCents(state.balanceCents)}",
style = Type.body,
color = t.textMuted,
modifier = Modifier.testTag("TxnCurrentBalance"),
)
Segmented(
selected = if (state.type == TxnType.credit) 0 else 1,
labels = listOf("Credit", "Debit"),
@@ -19,6 +19,7 @@ import app.folio.ui.theme.Type
fun Header(
title: String,
subtitle: String? = null,
detail: @Composable (() -> Unit)? = null,
left: @Composable (() -> Unit)? = null,
right: @Composable (() -> Unit)? = null,
) {
@@ -42,6 +43,7 @@ fun Header(
if (subtitle != null) {
Text(subtitle, style = Type.caption, color = t.textMuted)
}
if (detail != null) detail()
}
if (right != null) right()
}