disable next btn if amount is 0
This commit is contained in:
parent
59153170bf
commit
bb9db73182
@ -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,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user