mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Implement product view
This commit is contained in:
parent
1ced06b24e
commit
fc51e7f1a3
18 changed files with 444 additions and 52 deletions
|
@ -1,18 +1,29 @@
|
|||
import { Button } from '@wordpress/components';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
|
||||
const Navigation = ( { setStep, currentStep } ) => {
|
||||
const Navigation = ( {
|
||||
setStep,
|
||||
currentStep,
|
||||
stepperOrder,
|
||||
canProceeedCallback = () => true,
|
||||
} ) => {
|
||||
const setNextStep = ( nextStep ) => {
|
||||
let newStep = currentStep + nextStep;
|
||||
if ( newStep > stepperOrder.length - 1 ) {
|
||||
newStep = currentStep;
|
||||
}
|
||||
setStep( newStep );
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="ppcp-r-navigation">
|
||||
<Button
|
||||
variant="tertiary"
|
||||
onClick={ () => setStep( currentStep - 1 ) }
|
||||
>
|
||||
<Button variant="tertiary" onClick={ () => setNextStep( -1 ) }>
|
||||
{ __( 'Back', 'woocommerce-paypal-payments' ) }
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
onClick={ () => setStep( currentStep + 1 ) }
|
||||
disabled={ ! canProceeedCallback() }
|
||||
onClick={ () => setNextStep( 1 ) }
|
||||
>
|
||||
{ __( 'Next', 'woocommerce-paypal-payments' ) }
|
||||
</Button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue