diff --git a/src/forms/PayoutDetailsForm/PayoutDetailsCompany.js b/src/forms/PayoutDetailsForm/PayoutDetailsCompany.js new file mode 100644 index 00000000..e0f5385d --- /dev/null +++ b/src/forms/PayoutDetailsForm/PayoutDetailsCompany.js @@ -0,0 +1,137 @@ +import React from 'react'; +import { bool, string } from 'prop-types'; +import { FormattedMessage, intlShape } from 'react-intl'; +import * as validators from '../../util/validators'; +import { FieldPhoneNumberInput, FieldTextInput } from '../../components'; + +import * as normalizePhoneNumberUS from './normalizePhoneNumberUS'; +import PayoutDetailsBusinessProfile from './PayoutDetailsBusinessProfile'; +import css from './PayoutDetailsForm.css'; + +const PayoutDetailsCompany = props => { + const { + fieldId, + disabled, + intl, + country, + showBusinessURLField, + showMCCForUSField, + showPhoneNumberField, + } = props; + + const companyNameLabel = intl.formatMessage({ id: 'PayoutDetailsForm.companyNameLabel' }); + const companyNamePlaceholder = intl.formatMessage({ + id: 'PayoutDetailsForm.companyNamePlaceholder', + }); + const companyNameRequired = validators.required( + intl.formatMessage({ + id: 'PayoutDetailsForm.companyNameRequired', + }) + ); + + const companyTaxIdLabel = intl.formatMessage({ + id: `PayoutDetailsForm.companyTaxIdLabel.${country}`, + }); + const companyTaxIdPlaceholder = intl.formatMessage( + { + id: 'PayoutDetailsForm.companyTaxIdPlaceholder', + }, + { + idName: companyTaxIdLabel, + } + ); + const companyTaxIdRequired = validators.required( + intl.formatMessage( + { + id: 'PayoutDetailsForm.companyTaxIdRequired', + }, + { + idName: companyTaxIdLabel, + } + ) + ); + + const phoneLabel = intl.formatMessage({ id: 'PayoutDetailsForm.companyPhoneLabel' }); + const phonePlaceholder = intl.formatMessage({ + id: 'PayoutDetailsForm.companyPhonePlaceholder', + }); + const phoneNumberForUSRequired = validators.required( + intl.formatMessage({ id: 'PayoutDetailsForm.companyPhoneRequired' }) + ); + + return ( +