Skip to content

Commit

Permalink
fix: express checkouts links consistency (#7198)
Browse files Browse the repository at this point in the history
  • Loading branch information
frosso authored Sep 14, 2023
1 parent 0c2de49 commit 502d50c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 37 deletions.
4 changes: 4 additions & 0 deletions changelog/fix-express-checkouts-links-consistency
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

express checkout links UI consistency & area increase
7 changes: 4 additions & 3 deletions client/settings/express-checkout/apple-google-pay-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { CheckboxControl } from '@wordpress/components';
import { Button, CheckboxControl } from '@wordpress/components';
import interpolateComponents from '@automattic/interpolate-components';
import React from 'react';

Expand Down Expand Up @@ -150,13 +150,14 @@ const AppleGooglePayExpressCheckoutItem = (): React.ReactElement => {
</div>
</div>
<div className="express-checkout__link">
<a
<Button
href={ getPaymentMethodSettingsUrl(
'payment_request'
) }
isSecondary
>
{ __( 'Customize', 'woocommerce-payments' ) }
</a>
</Button>
</div>
</div>
</div>
Expand Down
34 changes: 13 additions & 21 deletions client/settings/express-checkout/link-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import React from 'react';
import { __ } from '@wordpress/i18n';
import { CheckboxControl, VisuallyHidden } from '@wordpress/components';
import { Button, CheckboxControl, VisuallyHidden } from '@wordpress/components';
import interpolateComponents from '@automattic/interpolate-components';

/**
Expand Down Expand Up @@ -154,26 +154,18 @@ const LinkExpressCheckoutItem = (): React.ReactElement => {
</div>
</div>
<div className="express-checkout__link">
{
/* eslint-disable jsx-a11y/anchor-has-content */
interpolateComponents( {
mixedString: __(
'{{linkDocs}}Read more{{/linkDocs}}',
'woocommerce-payments'
),
components: {
linkDocs: (
<a
target="_blank"
rel="noreferrer"
/* eslint-disable-next-line max-len */
href="https://woocommerce.com/document/woopayments/payment-methods/link-by-stripe/"
/>
),
},
} )
/* eslint-enable jsx-a11y/anchor-has-content */
}
<Button
target="_blank"
rel="noreferrer"
/* eslint-disable-next-line max-len */
href="https://woocommerce.com/document/woopayments/payment-methods/link-by-stripe/"
isSecondary
>
{ __(
'Read more',
'woocommerce-payments'
) }
</Button>
</div>
</div>
</div>
Expand Down
10 changes: 0 additions & 10 deletions client/settings/express-checkout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,8 @@
}

&__link {
padding: 12px;
border: 1px solid #007cba;
border-radius: 2px;
font-size: 12px;
height: 18px;
align-self: center;

a {
text-decoration: none;
white-space: nowrap;
}

@include breakpoint( '<660px' ) {
align-self: flex-start;
margin-top: 20px;
Expand Down
7 changes: 4 additions & 3 deletions client/settings/express-checkout/woopay-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import React from 'react';
import { __ } from '@wordpress/i18n';
import { CheckboxControl, VisuallyHidden } from '@wordpress/components';
import { Button, CheckboxControl, VisuallyHidden } from '@wordpress/components';
import WooIcon from 'assets/images/payment-methods/woo.svg?asset';
import interpolateComponents from '@automattic/interpolate-components';
import { getPaymentMethodSettingsUrl } from '../../utils';
Expand Down Expand Up @@ -162,16 +162,17 @@ const WooPayExpressCheckoutItem = (): React.ReactElement => {
</div>

<div className="express-checkout__link">
<a
<Button
href={ getPaymentMethodSettingsUrl(
'woopay'
) }
isSecondary
>
{ __(
'Customize',
'woocommerce-payments'
) }
</a>
</Button>
</div>
</div>
</div>
Expand Down

0 comments on commit 502d50c

Please sign in to comment.