disable next btn if amount is 0

This commit is contained in:
moon 2026-08-25 22:42:18 +06:30
parent 59153170bf
commit bb9db73182

View File

@ -171,16 +171,16 @@ fun InputAmount(
Text("Cancel") Text("Cancel")
} }
val isAmountValid = amount.toDoubleOrNull()?.let { it > 0.0 } == true
Button( Button(
onClick = { onClick = {
if (amount.isNotEmpty()) { onChargeClick(amount)
onChargeClick(amount)
}
}, },
modifier = Modifier modifier = Modifier
.weight(1f) .weight(1f)
.height(56.dp), .height(56.dp),
enabled = amount.isNotEmpty(), enabled = isAmountValid,
shape = RoundedCornerShape(8.dp), shape = RoundedCornerShape(8.dp),
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
containerColor = Color.LegacyRed, containerColor = Color.LegacyRed,