mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
💄 For send-only country: Hide Save, add CTA
This commit is contained in:
parent
609fe0fd59
commit
b9282b510c
2 changed files with 21 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
import { __, sprintf } from '@wordpress/i18n';
|
||||
import { Button } from '@wordpress/components';
|
||||
|
||||
import Container from '../ReusableComponents/Container';
|
||||
import SettingsCard from '../ReusableComponents/SettingsCard';
|
||||
|
@ -9,7 +10,7 @@ const SendOnlyMessage = () => {
|
|||
|
||||
return (
|
||||
<>
|
||||
<SettingsNavigation />
|
||||
<SettingsNavigation canSave={ false } />
|
||||
<Container page="settings">
|
||||
<SettingsCard
|
||||
title={ __(
|
||||
|
@ -45,6 +46,19 @@ const SendOnlyMessage = () => {
|
|||
),
|
||||
} }
|
||||
/>
|
||||
|
||||
<div>
|
||||
<Button
|
||||
href={ settingsPageUrl }
|
||||
variant="primary"
|
||||
className="small-button"
|
||||
>
|
||||
{ __(
|
||||
'Go to WooCommerce settings',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
</Button>
|
||||
</div>
|
||||
</SettingsCard>
|
||||
</Container>
|
||||
</>
|
||||
|
|
|
@ -4,16 +4,18 @@ import { __ } from '@wordpress/i18n';
|
|||
import TopNavigation from '../../../ReusableComponents/TopNavigation';
|
||||
import { useSaveSettings } from '../../../../hooks/useSaveSettings';
|
||||
|
||||
const SettingsNavigation = () => {
|
||||
const SettingsNavigation = ( { canSave = true } ) => {
|
||||
const { persistAll } = useSaveSettings();
|
||||
|
||||
const title = __( 'PayPal Payments', 'woocommerce-paypal-payments' );
|
||||
|
||||
return (
|
||||
<TopNavigation title={ title } exitOnTitleClick={ true }>
|
||||
<Button variant="primary" onClick={ persistAll }>
|
||||
{ __( 'Save', 'woocommerce-paypal-payments' ) }
|
||||
</Button>
|
||||
{ canSave && (
|
||||
<Button variant="primary" onClick={ persistAll }>
|
||||
{ __( 'Save', 'woocommerce-paypal-payments' ) }
|
||||
</Button>
|
||||
) }
|
||||
</TopNavigation>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue