Implement product view

This commit is contained in:
inpsyde-maticluznar 2024-10-24 13:54:50 +02:00
parent 1ced06b24e
commit fc51e7f1a3
No known key found for this signature in database
GPG key ID: D005973F231309F6
18 changed files with 444 additions and 52 deletions

View file

@ -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>