Skip to content

Commit

Permalink
Merge pull request #5055 from Jakub-CZ/button-buy-bsq
Browse files Browse the repository at this point in the history
Add "Buy BSQ" button next to trade fee selector
  • Loading branch information
ripcurlx authored Nov 8, 2021
2 parents 851bdcf + 07e224e commit 00d7913
Show file tree
Hide file tree
Showing 26 changed files with 574 additions and 394 deletions.
16 changes: 16 additions & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ market.trades.showVolumeInUSD=Show volume in USD

offerbook.createOffer=Create offer
offerbook.takeOffer=Take offer
offerbook.takeOffer.createAccount=Create account and take offer
offerbook.takeOfferToBuy=Take offer to buy {0}
offerbook.takeOfferToSell=Take offer to sell {0}
offerbook.trader=Trader
Expand Down Expand Up @@ -388,6 +389,7 @@ offerbook.createOfferToBuy.withFiat=Create new offer to buy {0} with {1}
offerbook.createOfferToSell.forFiat=Create new offer to sell {0} for {1}
offerbook.createOfferToBuy.withCrypto=Create new offer to sell {0} (buy {1})
offerbook.createOfferToSell.forCrypto=Create new offer to buy {0} (sell {1})
offerbook.createOfferDisabled.tooltip=You can only create one offer at a time

offerbook.takeOfferButton.tooltip=Take offer for {0}
offerbook.yesCreateOffer=Yes, create offer
Expand All @@ -402,6 +404,7 @@ offerbook.warning.noTradingAccountForCurrency.headline=No payment account for se
offerbook.warning.noTradingAccountForCurrency.msg=You don't have a payment account set up for the selected currency.\n\nWould you like to create an offer for another currency instead?
offerbook.warning.noMatchingAccount.headline=No matching payment account.
offerbook.warning.noMatchingAccount.msg=This offer uses a payment method you haven't set up yet. \n\nWould you like to set up a new payment account now?
offerbook.warning.noMatchingBsqAccount.msg=This offer uses BSQ as a payment method you haven't set up yet. \n\nWould you like to automatically create an account now?

offerbook.warning.counterpartyTradeRestrictions=This offer cannot be taken due to counterparty trade restrictions

Expand Down Expand Up @@ -440,6 +443,13 @@ offerbook.info.buyAtFixedPrice=You will buy at this fixed price.
offerbook.info.sellAtFixedPrice=You will sell at this fixed price.
offerbook.info.noArbitrationInUserLanguage=In case of a dispute, please note that arbitration for this offer will be handled in {0}. Language is currently set to {1}.
offerbook.info.roundedFiatVolume=The amount was rounded to increase the privacy of your trade.
offerbook.info.accountCreated.headline=Congratulations
offerbook.info.accountCreated.message=You''ve just successfully created a BSQ payment account.\n\
Your account can be found under Account > Altcoins Accounts > {0} and your BSQ wallet under DAO > BSQ Wallet.\n\n
offerbook.info.accountCreated.tradeInstant=You've chosen to take a BSQ instant offer, so a BSQ instant payment account was created for you. \
Be aware that instant trades are meant to be completed within 1 hour, \
so you should be online and available for the next 1 hour.\n\n
offerbook.info.accountCreated.takeOffer=You can now proceed to take this offer after closing this popup.

offerbook.bsqSwap.createOffer=Create Bsq swap offer

Expand Down Expand Up @@ -481,6 +491,11 @@ createOffer.triggerPrice.tooltip=As protection against drastic price movements y
createOffer.triggerPrice.invalid.tooLow=Value must be higher than {0}
createOffer.triggerPrice.invalid.tooHigh=Value must be lower than {0}

createOffer.buyBsq.popupMessage=Trading fees are paid to fund the Bisq DAO. Fees can be paid in BSQ or BTC.\n\n\
BSQ fees directly help fund Bisq's development, so Bisq encourages traders to use BSQ by offering a 50% discount on trading fees. \
This discount varies as the BSQ/BTC rate fluctuates. To maintain the 50% discount target, trading fees are updated every cycle as necessary.\n\n\
For more about fees, see [HYPERLINK:https://bisq.wiki/Trading_fees]. For more about trading BSQ, see [HYPERLINK:https://bisq.wiki/Trading_BSQ]. For more about the Bisq DAO, see [HYPERLINK:https://bisq.wiki/Introduction_to_the_DAO#The_Bisq_DAO].

# new entries
createOffer.placeOfferButton=Review: Place offer to {0} bitcoin
createOffer.createOfferFundWalletInfo.headline=Fund your offer
Expand Down Expand Up @@ -860,6 +875,7 @@ portfolio.pending.step3_seller.xmrTxHash=Transaction ID
portfolio.pending.step3_seller.xmrTxKey=Transaction key
portfolio.pending.step3_seller.buyersAccount=Buyers account data
portfolio.pending.step3_seller.confirmReceipt=Confirm payment receipt
portfolio.pending.step3_seller.showBsqWallet=Show payment in BSQ wallet
portfolio.pending.step3_seller.buyerStartedPayment=The BTC buyer has started the {0} payment.\n{1}
portfolio.pending.step3_seller.buyerStartedPayment.altcoin=Check for blockchain confirmations at your altcoin wallet or block explorer and confirm the payment when you have sufficient blockchain confirmations.
portfolio.pending.step3_seller.buyerStartedPayment.fiat=Check at your trading account (e.g. bank account) and confirm when you have received the payment.
Expand Down
8 changes: 8 additions & 0 deletions desktop/src/main/java/bisq/desktop/bisq.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@
-fx-padding: 0 10 0 10;
}

.tiny-button,
.action-button.tiny-button {
-fx-font-size: 0.769em;
-fx-pref-height: 20;
-fx-padding: 3 8 3 8;
-fx-border-radius: 5;
}

.text-button {
-fx-background-color: transparent;
-fx-underline: true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ public HyperlinkWithIcon(String text) {
this(text, AwesomeIcon.INFO_SIGN);
}

public HyperlinkWithIcon(String text, AwesomeIcon awesomeIcon) {
public HyperlinkWithIcon(String text, String fontSize) {
this(text, AwesomeIcon.INFO_SIGN, fontSize);
}

public HyperlinkWithIcon(String text, AwesomeIcon awesomeIcon, String fontSize) {
super(text);

Label icon = new Label();
AwesomeDude.setIcon(icon, awesomeIcon);
AwesomeDude.setIcon(icon, awesomeIcon, fontSize);
icon.setMinWidth(20);
icon.setOpacity(0.7);
icon.getStyleClass().addAll("hyperlink", "no-underline");
Expand All @@ -55,6 +59,10 @@ public HyperlinkWithIcon(String text, AwesomeIcon awesomeIcon) {
setIcon(icon);
}

public HyperlinkWithIcon(String text, AwesomeIcon awesomeIcon) {
this(text, awesomeIcon, "1.231em");
}

public HyperlinkWithIcon(String text, GlyphIcons icon) {
this(text, icon, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@

import bisq.common.util.Tuple2;

import org.apache.commons.lang3.StringUtils;

import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
Expand All @@ -62,8 +60,13 @@ public static int addFormForBuyer(GridPane gridPane, int gridRow,
return gridRow;
}

public AdvancedCashForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, AdvancedCashValidator advancedCashValidator,
InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
public AdvancedCashForm(PaymentAccount paymentAccount,
AccountAgeWitnessService accountAgeWitnessService,
AdvancedCashValidator advancedCashValidator,
InputValidator inputValidator,
GridPane gridPane,
int gridRow,
CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.advancedCashAccount = (AdvancedCashAccount) paymentAccount;
this.advancedCashValidator = advancedCashValidator;
Expand Down Expand Up @@ -101,12 +104,7 @@ private void addCurrenciesGrid(boolean isEditable) {

@Override
protected void autoFillNameTextField() {
if (useCustomAccountNameToggleButton != null && !useCustomAccountNameToggleButton.isSelected()) {
String accountNr = accountNrInputTextField.getText();
accountNr = StringUtils.abbreviate(accountNr, 9);
String method = Res.get(paymentAccount.getPaymentMethod().getId());
accountNameTextField.setText(method.concat(": ").concat(accountNr));
}
setAccountNameWithString(accountNrInputTextField.getText());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
import bisq.common.UserThread;
import bisq.common.util.Tuple3;

import org.apache.commons.lang3.StringUtils;

import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
Expand All @@ -53,6 +51,7 @@

import javafx.util.StringConverter;

import static bisq.desktop.util.DisplayUtils.createAssetsAccountName;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addLabelCheckBox;
Expand Down Expand Up @@ -167,12 +166,7 @@ public void updateFromInputs() {
@Override
protected void autoFillNameTextField() {
if (useCustomAccountNameToggleButton != null && !useCustomAccountNameToggleButton.isSelected()) {
String currency = paymentAccount.getSingleTradeCurrency() != null ? paymentAccount.getSingleTradeCurrency().getCode() : "";
if (currency != null) {
String address = addressInputTextField.getText();
address = StringUtils.abbreviate(address, 9);
accountNameTextField.setText(currency.concat(": ").concat(address));
}
accountNameTextField.setText(createAssetsAccountName(paymentAccount, addressInputTextField.getText()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@

import bisq.common.util.Tuple2;

import org.apache.commons.lang3.StringUtils;

import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
Expand Down Expand Up @@ -100,12 +98,7 @@ private void addCurrenciesGrid(boolean isEditable) {

@Override
protected void autoFillNameTextField() {
if (useCustomAccountNameToggleButton != null && !useCustomAccountNameToggleButton.isSelected()) {
String accountNr = accountNrInputTextField.getText();
accountNr = StringUtils.abbreviate(accountNr, 9);
String method = Res.get(paymentAccount.getPaymentMethod().getId());
accountNameTextField.setText(method.concat(": ").concat(accountNr));
}
setAccountNameWithString(accountNrInputTextField.getText());
}

@Override
Expand Down
Loading

0 comments on commit 00d7913

Please sign in to comment.