Wise: fix account summary and add copy icon to form.

Add copy icon to Pix form holder name field.
Prompt for holder name if empty.
Optimize form layout.
This commit is contained in:
yonson2023 2023-12-31 13:23:12 -06:00
parent e9e62b9e48
commit 25a6e08c09
No known key found for this signature in database
GPG key ID: 653F31AF4087E2F2
4 changed files with 14 additions and 10 deletions

View file

@ -91,8 +91,8 @@ public final class PixAccountPayload extends CountryBasedPaymentAccountPayload {
@Override
public String getPaymentDetailsForTradePopup() {
return (getHolderName().isEmpty() ? "" : Res.getWithCol("payment.account.owner") + " " + getHolderName() + "\n") +
Res.getWithCol("payment.pix.key") + " " + pixKey;
return Res.getWithCol("payment.pix.key") + " " + pixKey + "\n" +
Res.getWithCol("payment.account.owner") + " " + getHolderNameOrPromptIfEmpty();
}
@Override

View file

@ -86,12 +86,13 @@ public final class TransferwiseAccountPayload extends PaymentAccountPayload {
@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.email") + " " + email;
return Res.get(paymentMethodId) + " - " + getPaymentDetailsForTradePopup().replace("\n", ", ");
}
@Override
public String getPaymentDetailsForTradePopup() {
return getPaymentDetails();
return Res.getWithCol("payment.email") + " " + email + "\n" +
Res.getWithCol("payment.account.owner") + " " + getHolderNameOrPromptIfEmpty();
}
@Override

View file

@ -35,6 +35,7 @@ import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon;
@ -45,8 +46,8 @@ public class PixForm extends PaymentMethodForm {
PaymentAccountPayload paymentAccountPayload) {
addTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.pix.key"),
((PixAccountPayload) paymentAccountPayload).getPixKey(), Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE);
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
paymentAccountPayload.getHolderName());
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.owner"),
paymentAccountPayload.getHolderNameOrPromptIfEmpty());
return gridRow;
}

View file

@ -19,6 +19,7 @@ package bisq.desktop.components.paymentmethods;
import bisq.desktop.components.InputTextField;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.Layout;
import bisq.desktop.util.validation.TransferwiseValidator;
import bisq.core.account.witness.AccountAgeWitnessService;
@ -36,6 +37,7 @@ import javafx.scene.layout.GridPane;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon;
public class TransferwiseForm extends PaymentMethodForm {
private final TransferwiseAccount account;
@ -43,10 +45,10 @@ public class TransferwiseForm extends PaymentMethodForm {
public static int addFormForBuyer(GridPane gridPane, int gridRow,
PaymentAccountPayload paymentAccountPayload) {
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.email"),
((TransferwiseAccountPayload) paymentAccountPayload).getEmail());
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
paymentAccountPayload.getHolderName());
addTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.email"),
((TransferwiseAccountPayload) paymentAccountPayload).getEmail(), Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE);
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.owner"),
paymentAccountPayload.getHolderNameOrPromptIfEmpty());
return gridRow;
}