[#594] Don't Allow user to proceed to send funds if they are not available for spend (#629)

- send button disable/enable logic
- `clear` button of the address field removed
This commit is contained in:
Lukas Korba 2023-03-07 22:16:43 +01:00 committed by GitHub
parent 6c77e0901b
commit effa4b304a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 14 deletions

View File

@ -48,6 +48,8 @@ struct CreateTransaction: View {
label: { Text(L10n.General.send) }
)
.activeButtonStyle
.disabled(viewStore.isValidForm)
.opacity(viewStore.isValidForm ? 1.0 : 0.5)
Spacer()
}

View File

@ -21,20 +21,8 @@ struct TransactionAddressTextField: View {
state: \.textFieldState,
action: TransactionAddressTextFieldReducer.Action.textField
),
titleAccessoryView: {
if !viewStore.textFieldState.text.data.isEmpty {
Button(
action: {
viewStore.send(.clearAddress)
},
label: {
Text(L10n.General.clear)
}
)
.textFieldTitleAccessoryButtonStyle
}
},
inputPrefixView: { EmptyView() },
titleAccessoryView: { },
inputPrefixView: { },
inputAccessoryView: {
Button {
viewStore.send(.scanQR)