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 ; + return ; }; export default DisputeStatusChip; diff --git a/client/components/payment-status-chip/index.js b/client/components/payment-status-chip/index.js index b26da2ad4ed..fb57843849b 100755 --- a/client/components/payment-status-chip/index.js +++ b/client/components/payment-status-chip/index.js @@ -11,11 +11,11 @@ import displayStatus from './mappings'; import Chip from '../chip'; import { formatStringValue } from 'utils'; -const PaymentStatusChip = ( { status } ) => { +const PaymentStatusChip = ( { status, className } ) => { const mapping = displayStatus[ status ] || {}; const message = mapping.message || formatStringValue( status ); const type = mapping.type || 'light'; - return ; + return ; }; export default PaymentStatusChip; diff --git a/client/payment-details/dispute-details/dispute-notice.tsx b/client/payment-details/dispute-details/dispute-notice.tsx index 9d9edd8a9f7..d2c8b00fbf2 100644 --- a/client/payment-details/dispute-details/dispute-notice.tsx +++ b/client/payment-details/dispute-details/dispute-notice.tsx @@ -64,7 +64,12 @@ const DisputeNotice: React.FC< DisputeNoticeProps > = ( { { createInterpolateElement( sprintf( noticeText, shopperDisputeReason ), { - a: , + a: ( + + ), strong: , } ) } diff --git a/client/payment-details/dispute-details/style.scss b/client/payment-details/dispute-details/style.scss index 60773396b54..b68be2d0a20 100644 --- a/client/payment-details/dispute-details/style.scss +++ b/client/payment-details/dispute-details/style.scss @@ -182,3 +182,17 @@ margin-bottom: 0; } } + +.dispute-notice { + .dispute-notice__link { + display: block; + } +} + +@media screen and ( max-width: $break-small ) { + .wcpay-inline-notice.components-notice + .components-notice__content + a.dispute-notice__link { + white-space: normal; + } +} diff --git a/client/payment-details/order-details/test/__snapshots__/index.test.tsx.snap b/client/payment-details/order-details/test/__snapshots__/index.test.tsx.snap index 9fa0098691b..7b4a7e3650f 100644 --- a/client/payment-details/order-details/test/__snapshots__/index.test.tsx.snap +++ b/client/payment-details/order-details/test/__snapshots__/index.test.tsx.snap @@ -30,21 +30,25 @@ exports[`Order details page should match the snapshot - Charge without payment i
-

- $15.00 - - USD - + $15.00 + + USD + +

Pending -

+
diff --git a/client/payment-details/summary/index.tsx b/client/payment-details/summary/index.tsx index 261645c8a85..06699f07147 100644 --- a/client/payment-details/summary/index.tsx +++ b/client/payment-details/summary/index.tsx @@ -257,37 +257,41 @@ const PaymentDetailsSummary: React.FC< PaymentDetailsSummaryProps > = ( {
-

- - { formattedAmount } - - { charge.currency || 'USD' } - - { charge.dispute ? ( - - ) : ( - - ) } - -

+
+

+ + { formattedAmount } + + { charge.currency || 'USD' } + + +

+ { charge.dispute ? ( + + ) : ( + + ) } +
{ renderStorePrice ? (

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 -

+
@@ -362,21 +366,25 @@ exports[`PaymentDetailsSummary capture notification and fraud buttons renders th
-

- $20.00 - - usd - + $20.00 + + usd + +

Needs review -

+
@@ -708,21 +716,25 @@ exports[`PaymentDetailsSummary correctly renders a charge 1`] = `
-

- $20.00 - - usd - + $20.00 + + usd + +

Paid -

+
@@ -1029,21 +1041,25 @@ exports[`PaymentDetailsSummary correctly renders when payment intent is missing
-

- $20.00 - - usd - + $20.00 + + usd + +

Paid -

+
@@ -1336,21 +1352,25 @@ exports[`PaymentDetailsSummary order missing notice does not render notice if or
-

- $20.00 - - usd - + $20.00 + + usd + +

Paid -

+
@@ -1657,21 +1677,25 @@ exports[`PaymentDetailsSummary order missing notice renders notice if order miss
-

- $20.00 - - usd - + $20.00 + + usd + +

Paid -

+
@@ -2001,21 +2025,25 @@ exports[`PaymentDetailsSummary renders a charge with subscriptions 1`] = `
-

- $20.00 - - usd - + $20.00 + + usd + +

Paid -

+
@@ -2349,21 +2377,25 @@ exports[`PaymentDetailsSummary renders fully refunded information for a charge 1
-

- $20.00 - - usd - + $20.00 + + usd + +

Refunded -

+
@@ -2647,19 +2679,23 @@ exports[`PaymentDetailsSummary renders loading state 1`] = `
-

- - - USD - + + + USD + +

-

+
@@ -2887,21 +2923,25 @@ exports[`PaymentDetailsSummary renders partially refunded information for a char
-

- $20.00 - - usd - + $20.00 + + usd + +

Partial refund -

+
@@ -3211,21 +3251,25 @@ exports[`PaymentDetailsSummary renders the Tap to Pay channel from metadata 1`]
-

- $20.00 - - usd - + $20.00 + + usd + +

Paid -

+
@@ -3532,21 +3576,25 @@ exports[`PaymentDetailsSummary renders the information of a dispute-reversal cha
-

- $20.00 - - usd - + $20.00 + + usd + +

Disputed: Won -

+
diff --git a/client/payment-details/test/__snapshots__/index.test.tsx.snap b/client/payment-details/test/__snapshots__/index.test.tsx.snap index 0798e4b5d52..aa8a34effd0 100644 --- a/client/payment-details/test/__snapshots__/index.test.tsx.snap +++ b/client/payment-details/test/__snapshots__/index.test.tsx.snap @@ -30,16 +30,25 @@ exports[`Payment details page should match the snapshot - Charge query param 1`]
-

+

+ + Amount placeholder + +

- Amount placeholder + Paid -

+
@@ -493,21 +502,25 @@ exports[`Payment details page should match the snapshot - Payment Intent query p
-

- $1,500.00 - - usd - + $1,500.00 + + usd + +

Paid -

+