diff --git a/examples/folio/app/shared/src/commonMain/kotlin/app/folio/feature/ledger/AddTransactionScreen.kt b/examples/folio/app/shared/src/commonMain/kotlin/app/folio/feature/ledger/AddTransactionScreen.kt index 7f6c9f8..10e0cc4 100644 --- a/examples/folio/app/shared/src/commonMain/kotlin/app/folio/feature/ledger/AddTransactionScreen.kt +++ b/examples/folio/app/shared/src/commonMain/kotlin/app/folio/feature/ledger/AddTransactionScreen.kt @@ -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"), diff --git a/examples/folio/app/ui-components/src/commonMain/kotlin/app/folio/ui/component/Header.kt b/examples/folio/app/ui-components/src/commonMain/kotlin/app/folio/ui/component/Header.kt index 58af281..1105be8 100644 --- a/examples/folio/app/ui-components/src/commonMain/kotlin/app/folio/ui/component/Header.kt +++ b/examples/folio/app/ui-components/src/commonMain/kotlin/app/folio/ui/component/Header.kt @@ -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() }