From dc6f74cb48b4da74d0ba37e6709570b2dd51d243 Mon Sep 17 00:00:00 2001
From: Shendy <73803630+shendy-a8c@users.noreply.github.com>
Date: Tue, 3 Dec 2024 04:35:45 +0700
Subject: [PATCH] Fix styling on payment details page in mobile view. (#9790)
---
.../fix-7230-payments-details-mobile-view | 4 +
.../components/dispute-status-chip/index.tsx | 4 +-
.../components/payment-status-chip/index.js | 4 +-
.../dispute-details/dispute-notice.tsx | 7 +-
.../dispute-details/style.scss | 14 +
.../test/__snapshots__/index.test.tsx.snap | 22 +-
client/payment-details/summary/index.tsx | 66 +++--
client/payment-details/summary/style.scss | 22 +-
.../test/__snapshots__/index.test.tsx.snap | 264 +++++++++++-------
.../test/__snapshots__/index.test.tsx.snap | 43 ++-
10 files changed, 280 insertions(+), 170 deletions(-)
create mode 100644 changelog/fix-7230-payments-details-mobile-view
diff --git a/changelog/fix-7230-payments-details-mobile-view b/changelog/fix-7230-payments-details-mobile-view
new file mode 100644
index 00000000000..93e179a44ca
--- /dev/null
+++ b/changelog/fix-7230-payments-details-mobile-view
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Fix styling of transaction details page in mobile view.
diff --git a/client/components/dispute-status-chip/index.tsx b/client/components/dispute-status-chip/index.tsx
index 393089a8a78..dde601f3de7 100644
--- a/client/components/dispute-status-chip/index.tsx
+++ b/client/components/dispute-status-chip/index.tsx
@@ -23,11 +23,13 @@ interface Props {
status: DisputeStatus | string;
dueBy?: CachedDispute[ 'due_by' ] | EvidenceDetails[ 'due_by' ];
prefixDisputeType?: boolean;
+ className?: string;
}
const DisputeStatusChip: React.FC< Props > = ( {
status,
dueBy,
prefixDisputeType,
+ className,
} ) => {
const mapping = displayStatus[ status ] || {};
let message = mapping.message || formatStringValue( status );
@@ -50,7 +52,7 @@ const DisputeStatusChip: React.FC< Props > = ( {
type = 'alert';
}
- return
- $15.00 - - USD - + $15.00 + + USD + +
Pending - +
-
+
diff --git a/client/payment-details/summary/style.scss b/client/payment-details/summary/style.scss index ef67a756663..0c6c7775733 100755 --- a/client/payment-details/summary/style.scss +++ b/client/payment-details/summary/style.scss @@ -11,7 +11,7 @@ .payment-details-summary { display: flex; flex: 1; - @include breakpoint( '<660px' ) { + @media screen and ( max-width: $break-medium ) { flex-direction: column; } @@ -19,13 +19,29 @@ flex-grow: 1; } + .payment-details-summary__amount-wrapper { + display: flex; + align-items: center; + } + + @media screen and ( max-width: $break-small ) { + .payment-details-summary__amount-wrapper { + flex-direction: column; + align-items: flex-start; + + .payment-details-summary__status { + order: -1; + } + } + } + .payment-details-summary__amount { @include font-size( 32 ); font-weight: 300; padding: 0; margin: 0; display: flex; - flex-wrap: wrap; + flex-wrap: nowrap; align-items: center; .payment-details-summary__amount-currency { @@ -93,7 +109,7 @@ justify-content: initial; flex-direction: column; flex-wrap: nowrap; - @include breakpoint( '>660px' ) { + @media screen and ( min-width: $break-medium ) { justify-content: flex-start; align-items: flex-end; } diff --git a/client/payment-details/summary/test/__snapshots__/index.test.tsx.snap b/client/payment-details/summary/test/__snapshots__/index.test.tsx.snap index 8286a7941bb..083da902f05 100644 --- a/client/payment-details/summary/test/__snapshots__/index.test.tsx.snap +++ b/client/payment-details/summary/test/__snapshots__/index.test.tsx.snap @@ -26,21 +26,25 @@ exports[`PaymentDetailsSummary capture notification and fraud buttons renders ca
- $20.00 - - usd - + $20.00 + + usd + +
Payment authorized - +- $20.00 - - usd - + $20.00 + + usd + +
Needs review - +- $20.00 - - usd - + $20.00 + + usd + +
Paid - +- $20.00 - - usd - + $20.00 + + usd + +
Paid - +- $20.00 - - usd - + $20.00 + + usd + +
Paid - +- $20.00 - - usd - + $20.00 + + usd + +
Paid - +- $20.00 - - usd - + $20.00 + + usd + +
Paid - +- $20.00 - - usd - + $20.00 + + usd + +
Refunded - +- - - USD - + + + USD + +
- +- $20.00 - - usd - + $20.00 + + usd + +
Partial refund - +- $20.00 - - usd - + $20.00 + + usd + +
Paid - +- $20.00 - - usd - + $20.00 + + usd + +
Disputed: Won - ++
+ + Amount placeholder + +
- Amount placeholder + Paid - +- $1,500.00 - - usd - + $1,500.00 + + usd + +
Paid - +