diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/EnterTanDialog.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/EnterTanDialog.kt index 06bfaf9..0cf7ea7 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/EnterTanDialog.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/EnterTanDialog.kt @@ -20,8 +20,10 @@ import kotlinx.datetime.TimeZone import kotlinx.datetime.toLocalDateTime import net.codinux.banking.client.model.tan.* import net.codinux.banking.ui.composables.BankIcon +import net.codinux.banking.ui.config.Colors import net.codinux.banking.ui.config.DI import net.codinux.banking.ui.config.Internationalization +import net.codinux.banking.ui.forms.CaptionText import net.codinux.banking.ui.forms.OutlinedTextField import net.codinux.banking.ui.forms.Select import net.codinux.banking.ui.model.TanChallengeReceived @@ -45,6 +47,8 @@ fun EnterTanDialog(tanChallengeReceived: TanChallengeReceived, onDismiss: () -> val minTanImageHeight = 100 val maxTanImageHeight = 500 + var showSelectingTanMediumNotImplementedWarning by remember { mutableStateOf(false) } + val textFieldFocus = remember { FocusRequester() } var enteredTan by remember { mutableStateOf("") } @@ -131,10 +135,14 @@ fun EnterTanDialog(tanChallengeReceived: TanChallengeReceived, onDismiss: () -> "TAN Medium", challenge.availableTanMedia.sortedBy { it.status }.map { it.displayName }, challenge.selectedTanMedium?.displayName ?: "", - { Log.info { "User selected TanMedium $it" } }, // TODO: change TanMethod + { showSelectingTanMediumNotImplementedWarning = true }, // TODO: change TanMedium { it } ) } + + if (showSelectingTanMediumNotImplementedWarning) { + CaptionText("Es tut uns Leid, aber das Ändern des TAN Mediums ist gegenwärtig noch nicht implementiert", Colors.DestructiveColor, Arrangement.Start) + } } diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/TransferMoneyDialog.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/TransferMoneyDialog.kt index 948b6b6..4f00804 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/TransferMoneyDialog.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/TransferMoneyDialog.kt @@ -21,6 +21,7 @@ import net.codinux.banking.ui.composables.BankIcon import net.codinux.banking.ui.config.Colors import net.codinux.banking.ui.config.DI import net.codinux.banking.ui.forms.AutocompleteTextField +import net.codinux.banking.ui.forms.CaptionText import net.codinux.banking.ui.forms.OutlinedTextField import net.codinux.banking.ui.forms.Select import net.codinux.banking.ui.model.ShowTransferMoneyDialogData @@ -238,12 +239,7 @@ fun TransferMoneyDialog( } } - Row(Modifier.fillMaxWidth().padding(top = 4.dp), horizontalArrangement = Arrangement.End) { - Text( - text = "${paymentReference.length} / 140", - style = MaterialTheme.typography.caption - ) - } + CaptionText("${paymentReference.length} / 140") Row(Modifier.padding(top = verticalSpace), verticalAlignment = Alignment.CenterVertically) { diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/CaptionText.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/CaptionText.kt new file mode 100644 index 0000000..79fe34f --- /dev/null +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/CaptionText.kt @@ -0,0 +1,23 @@ +package net.codinux.banking.ui.forms + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material.MaterialTheme +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp + +@Composable +fun CaptionText(text: String, color: Color = Color.Unspecified, horizontalArrangement: Arrangement.Horizontal = Arrangement.End) { + Row(Modifier.fillMaxWidth().padding(top = 4.dp), horizontalArrangement = horizontalArrangement) { + Text( + text = text, + style = MaterialTheme.typography.caption, + color = color + ) + } +} \ No newline at end of file