woocommerce-paypal-payments/modules/ppcp-settings/resources/js/Components/Screens/Onboarding/StepBusiness.js

102 lines
2.7 KiB
JavaScript
Raw Normal View History

2024-10-23 15:24:52 +02:00
import OnboardingHeader from '../../ReusableComponents/OnboardingHeader.js';
import SelectBoxWrapper from '../../ReusableComponents/SelectBoxWrapper.js';
import SelectBox from '../../ReusableComponents/SelectBox.js';
import { __ } from '@wordpress/i18n';
import PaymentMethodIcons from '../../ReusableComponents/PaymentMethodIcons';
2024-10-24 06:35:48 +02:00
import { useState } from '@wordpress/element';
import Navigation from '../../ReusableComponents/Navigation';
2024-10-24 13:54:50 +02:00
const StepBusiness = ( { setStep, currentStep, stepperOrder } ) => {
2024-10-24 06:35:48 +02:00
const [ businessCategory, setBusinessCategory ] = useState( null );
const BUSINESS_RADIO_GROUP_NAME = 'business';
const CASUAL_SELLER_CHECKBOX_VALUE = 'casual_seller';
const BUSINESS_CHECKBOX_VALUE = 'business';
2024-10-23 15:24:52 +02:00
return (
2024-10-24 06:35:48 +02:00
<div className="ppcp-r-page-business">
2024-10-23 15:24:52 +02:00
<OnboardingHeader
title={ __(
'Tell Us About Your Business',
'woocommerce-paypal-payments'
) }
/>
<div className="ppcp-r-inner-container">
<SelectBoxWrapper>
<SelectBox
title={ __(
'Casual Seller',
'woocommerce-paypal-payments'
) }
description={ __(
'I sell occasionally and mainly use PayPal for personal transactions.',
'woocommerce-paypal-payments'
) }
icon="icon-business-casual-seller.svg"
2024-10-24 06:35:48 +02:00
name={ BUSINESS_RADIO_GROUP_NAME }
value={ CASUAL_SELLER_CHECKBOX_VALUE }
changeCallback={ setBusinessCategory }
currentValue={ businessCategory }
checked={
businessCategory ===
{ CASUAL_SELLER_CHECKBOX_VALUE }
}
2024-10-24 13:54:50 +02:00
type="radio"
2024-10-23 15:24:52 +02:00
>
<PaymentMethodIcons
icons={ [
'paypal',
'venmo',
'visa',
'mastercard',
'amex',
'discover',
] }
/>
</SelectBox>
<SelectBox
title={ __(
'Business',
'woocommerce-paypal-payments'
) }
description={ __(
'I run a registered business and sell full-time.',
'woocommerce-paypal-payments'
) }
icon="icon-business-business.svg"
2024-10-24 06:35:48 +02:00
name={ BUSINESS_RADIO_GROUP_NAME }
value={ BUSINESS_CHECKBOX_VALUE }
currentValue={ businessCategory }
changeCallback={ setBusinessCategory }
checked={
businessCategory === { BUSINESS_CHECKBOX_VALUE }
}
2024-10-24 13:54:50 +02:00
type="radio"
2024-10-23 15:24:52 +02:00
>
<PaymentMethodIcons
icons={ [
'paypal',
'venmo',
'visa',
'mastercard',
'amex',
'discover',
'apple-pay',
'google-pay',
'ideal',
] }
/>
</SelectBox>
</SelectBoxWrapper>
2024-10-24 13:54:50 +02:00
<Navigation
setStep={ setStep }
currentStep={ currentStep }
stepperOrder={ stepperOrder }
canProceeedCallback={ () => businessCategory !== null }
/>
2024-10-23 15:24:52 +02:00
</div>
</div>
);
};
export default StepBusiness;