From 1dba15331a5589b6406ec989701b9cd9e203c9f4 Mon Sep 17 00:00:00 2001 From: Hannu Lyytikainen Date: Tue, 18 Dec 2018 12:31:17 +0200 Subject: [PATCH] Streamline sale buttons visibility logic --- .../TransactionPanel/TransactionPanel.js | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/src/components/TransactionPanel/TransactionPanel.js b/src/components/TransactionPanel/TransactionPanel.js index 1340a95f..79d308dd 100644 --- a/src/components/TransactionPanel/TransactionPanel.js +++ b/src/components/TransactionPanel/TransactionPanel.js @@ -185,24 +185,20 @@ export class TransactionPanelComponent extends Component { currentListing.images && currentListing.images.length > 0 ? currentListing.images[0] : null; const actionButtonClasses = classNames(css.actionButtons); - const canShowActionButtons = canShowSaleButtons; - let actionButtons = null; - if (canShowSaleButtons) { - actionButtons = ( - - ); - } + const saleButtons = ( + + ); const sendMessagePlaceholder = intl.formatMessage( { id: 'TransactionPanel.sendMessagePlaceholder' }, @@ -293,8 +289,8 @@ export class TransactionPanelComponent extends Component { onBlur={this.onSendMessageFormBlur} onSubmit={this.onMessageSubmit} /> - {canShowActionButtons ? ( -
{actionButtons}
+ {canShowSaleButtons ? ( +
{saleButtons}
) : null} @@ -342,8 +338,8 @@ export class TransactionPanelComponent extends Component { transactionRole={transactionRole} /> - {canShowActionButtons ? ( -
{actionButtons}
+ {canShowSaleButtons ? ( +
{saleButtons}
) : null}