From 30300c7e4f265c12608a419d97d5f7cd0f715a29 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Mon, 16 May 2022 04:37:30 -0700 Subject: [PATCH] Improve connection of UI between Make and Book --- frontend/src/components/BookPage.js | 36 +++++++++++++++------------- frontend/src/components/HomePage.js | 4 ++-- frontend/src/components/MakerPage.js | 36 +++++++++++++++++++++------- 3 files changed, 49 insertions(+), 27 deletions(-) diff --git a/frontend/src/components/BookPage.js b/frontend/src/components/BookPage.js index eac6186f..4331abbe 100644 --- a/frontend/src/components/BookPage.js +++ b/frontend/src/components/BookPage.js @@ -49,7 +49,7 @@ class BookPage extends Component { handleCurrencyChange=(e)=>{ var currency = e.target.value; this.props.setAppState({ - bookCurrency: currency, + currency: currency, bookCurrencyCode: this.getCurrencyCode(currency), }) } @@ -85,8 +85,8 @@ class BookPage extends Component {
order.type == this.props.bookType || this.props.bookType == 2) - .filter(order => order.currency == this.props.bookCurrency || this.props.bookCurrency == 0) + this.props.bookOrders.filter(order => order.type == this.props.type || this.props.type == 2) + .filter(order => order.currency == this.props.currency || this.props.currency == 0) .map((order) => ({id: order.id, avatar: window.location.origin +'/static/assets/avatars/' + order.maker_nick + '.png', @@ -186,8 +186,8 @@ class BookPage extends Component { order.type == this.props.bookType || this.props.bookType == 2) - .filter(order => order.currency == this.props.bookCurrency || this.props.bookCurrency == 0) + this.props.bookOrders.filter(order => order.type == this.props.type || this.props.type == 2) + .filter(order => order.currency == this.props.currency || this.props.currency == 0) .map((order) => ({id: order.id, avatar: window.location.origin +'/static/assets/avatars/' + order.maker_nick + '.png', @@ -294,7 +294,7 @@ class BookPage extends Component { } else if (sellChecked) { var type = 0 } - this.props.setAppState({bookType: type}) + this.props.setAppState({type: type}) } handleClickBuy=(e)=>{ @@ -316,7 +316,7 @@ class BookPage extends Component { - {this.props.bookType == 0 ? + {this.props.type == 0 ? t("No orders found to sell BTC for {{currencyCode}}",{currencyCode:this.props.bookCurrencyCode}) : t("No orders found to buy BTC for {{currencyCode}}",{currencyCode:this.props.bookCurrencyCode}) @@ -328,7 +328,7 @@ class BookPage extends Component { - {t("Be the first one to create an order")} + {t("Be the first one to create an order")}

@@ -389,14 +389,14 @@ class BookPage extends Component { - {this.props.bookType == 0 ? t("and receive") : (this.props.bookType == 1 ? t("and pay with") : t("and use") )} + {this.props.type == 0 ? t("and receive") : (this.props.type == 1 ? t("and pay with") : t("and use") )}