Updated on 2026-08-14
This commit is contained in:
parent
9b294366d4
commit
a33272b37e
1 changed files with 10 additions and 9 deletions
|
|
@ -326,16 +326,8 @@ private fun SwapWarnings(warnings: List<SwapWarning>) {
|
|||
|
||||
@Composable
|
||||
private fun MainButton(state: SwapStateHolder, onPermissionWarningClick: () -> Unit) {
|
||||
// order is important
|
||||
when {
|
||||
state.warnings.any { it is SwapWarning.PermissionNeeded } -> {
|
||||
PrimaryButton(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
text = stringResource(id = R.string.swapping_give_permission),
|
||||
enabled = true,
|
||||
showProgress = state.swapButton.loading,
|
||||
onClick = onPermissionWarningClick,
|
||||
)
|
||||
}
|
||||
state.warnings.any { it is SwapWarning.InsufficientFunds } -> {
|
||||
PrimaryButton(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
|
|
@ -345,6 +337,15 @@ private fun MainButton(state: SwapStateHolder, onPermissionWarningClick: () -> U
|
|||
onClick = state.swapButton.onClick,
|
||||
)
|
||||
}
|
||||
state.warnings.any { it is SwapWarning.PermissionNeeded } -> {
|
||||
PrimaryButton(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
text = stringResource(id = R.string.swapping_give_permission),
|
||||
enabled = true,
|
||||
showProgress = state.swapButton.loading,
|
||||
onClick = onPermissionWarningClick,
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
PrimaryButtonIconEnd(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue