From effa4b304ab99616ee0fa26239cd08dfb032a4a7 Mon Sep 17 00:00:00 2001 From: Lukas Korba Date: Tue, 7 Mar 2023 22:16:43 +0100 Subject: [PATCH] [#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 --- .../SendFlow/Views/CreateTransactionView.swift | 2 ++ .../TransactionAddressTextField.swift | 16 ++-------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/secant/Features/SendFlow/Views/CreateTransactionView.swift b/secant/Features/SendFlow/Views/CreateTransactionView.swift index ba2db60..7ea4017 100644 --- a/secant/Features/SendFlow/Views/CreateTransactionView.swift +++ b/secant/Features/SendFlow/Views/CreateTransactionView.swift @@ -48,6 +48,8 @@ struct CreateTransaction: View { label: { Text(L10n.General.send) } ) .activeButtonStyle + .disabled(viewStore.isValidForm) + .opacity(viewStore.isValidForm ? 1.0 : 0.5) Spacer() } diff --git a/secant/UI Components/TextFields/TransactionAddress/TransactionAddressTextField.swift b/secant/UI Components/TextFields/TransactionAddress/TransactionAddressTextField.swift index 7d5f4f0..ae1f51d 100644 --- a/secant/UI Components/TextFields/TransactionAddress/TransactionAddressTextField.swift +++ b/secant/UI Components/TextFields/TransactionAddress/TransactionAddressTextField.swift @@ -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)