From b3c605ce71bc91327da74fd5f96b02006b1f9671 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Tue, 3 Oct 2023 10:21:08 +1000 Subject: [PATCH] Reorder inqury/dispute return to improve readability --- .../dispute-awaiting-response-details.tsx | 70 +++++++++---------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/client/payment-details/dispute-details/dispute-awaiting-response-details.tsx b/client/payment-details/dispute-details/dispute-awaiting-response-details.tsx index b38f43ec524..394d014df33 100644 --- a/client/payment-details/dispute-details/dispute-awaiting-response-details.tsx +++ b/client/payment-details/dispute-details/dispute-awaiting-response-details.tsx @@ -85,70 +85,68 @@ interface AcceptDisputeProps { * @param dispute */ function getAcceptDisputeProps( dispute: Dispute ): AcceptDisputeProps { - const isDispute = ! isInquiry( dispute ); - - if ( isDispute ) { + if ( isInquiry( dispute ) ) { return { - acceptButtonLabel: __( 'Accept dispute', 'woocommerce-payments' ), + acceptButtonLabel: __( 'Issue refund', 'woocommerce-payments' ), acceptButtonTracksEvent: - wcpayTracks.events.DISPUTE_ACCEPT_MODAL_VIEW, - modalTitle: __( 'Accept the dispute?', 'woocommerce-payments' ), + wcpayTracks.events.DISPUTE_INQUIRY_REFUND_MODAL_VIEW, + modalTitle: __( 'Issue a refund?', 'woocommerce-payments' ), modalLines: [ { icon: , - description: createInterpolateElement( - sprintf( - /* translators: %s: dispute fee, : emphasis HTML element. */ - __( - 'Accepting the dispute marks it as Lost. The disputed amount will be returned to the cardholder, with a %s dispute fee deducted from your account.', - 'woocommerce-payments' - ), - getDisputeFeeFormatted( dispute, true ) ?? '-' - ), - { - em: , - } + description: __( + 'Issuing a refund will close the inquiry, returning the amount in question back to the cardholder. No additional fees apply.', + 'woocommerce-payments' ), }, { - icon: , + icon: , description: __( - 'This action is final and cannot be undone.', + 'You will be taken to the order, where you must complete the refund process manually.', 'woocommerce-payments' ), }, ], - modalButtonLabel: __( 'Accept dispute', 'woocommerce-payments' ), - modalButtonTracksEvent: wcpayTracks.events.DISPUTE_ACCEPT_CLICK, + modalButtonLabel: __( + 'View order to issue refund', + 'woocommerce-payments' + ), + modalButtonTracksEvent: + wcpayTracks.events.DISPUTE_INQUIRY_REFUND_CLICK, }; } return { - acceptButtonLabel: __( 'Issue refund', 'woocommerce-payments' ), - acceptButtonTracksEvent: - wcpayTracks.events.DISPUTE_INQUIRY_REFUND_MODAL_VIEW, - modalTitle: __( 'Issue a refund?', 'woocommerce-payments' ), + acceptButtonLabel: __( 'Accept dispute', 'woocommerce-payments' ), + acceptButtonTracksEvent: wcpayTracks.events.DISPUTE_ACCEPT_MODAL_VIEW, + modalTitle: __( 'Accept the dispute?', 'woocommerce-payments' ), modalLines: [ { icon: , - description: __( - 'Issuing a refund will close the inquiry, returning the amount in question back to the cardholder. No additional fees apply.', - 'woocommerce-payments' + description: createInterpolateElement( + sprintf( + /* translators: %s: dispute fee, : emphasis HTML element. */ + __( + 'Accepting the dispute marks it as Lost. The disputed amount will be returned to the cardholder, with a %s dispute fee deducted from your account.', + 'woocommerce-payments' + ), + getDisputeFeeFormatted( dispute, true ) ?? '-' + ), + { + em: , + } ), }, { - icon: , + icon: , description: __( - 'You will be taken to the order, where you must complete the refund process manually.', + 'This action is final and cannot be undone.', 'woocommerce-payments' ), }, ], - modalButtonLabel: __( - 'View order to issue refund', - 'woocommerce-payments' - ), - modalButtonTracksEvent: wcpayTracks.events.DISPUTE_INQUIRY_REFUND_CLICK, + modalButtonLabel: __( 'Accept dispute', 'woocommerce-payments' ), + modalButtonTracksEvent: wcpayTracks.events.DISPUTE_ACCEPT_CLICK, }; }