mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Update PayoutDetailsAddress to contain section title
This commit is contained in:
parent
a3400f4933
commit
7dff8331aa
2 changed files with 17 additions and 9 deletions
|
|
@ -23,13 +23,19 @@ const CANADIAN_PROVINCES = [
|
|||
];
|
||||
|
||||
const PayoutDetailsAddress = props => {
|
||||
const { country, intl, disabled, form } = props;
|
||||
const { country, intl, disabled, form, companyAddress } = props;
|
||||
const countryConfig = country ? stripeCountryConfigs(country).addressConfig : null;
|
||||
|
||||
const isRequired = (countryConfig, field) => {
|
||||
return countryConfig[field];
|
||||
};
|
||||
|
||||
const addressTitle = intl.formatMessage({
|
||||
id: companyAddress
|
||||
? 'PayoutDetailsForm.companyAddressTitle'
|
||||
: 'PayoutDetailsForm.streetAddressLabel',
|
||||
});
|
||||
|
||||
const showAddressLine = country && isRequired(countryConfig, 'addressLine');
|
||||
|
||||
const streetAddressLabel = intl.formatMessage({
|
||||
|
|
@ -89,7 +95,9 @@ const PayoutDetailsAddress = props => {
|
|||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className={css.sectionContainer}>
|
||||
<h3 className={css.subTitle}>{addressTitle}</h3>
|
||||
|
||||
{showAddressLine ? (
|
||||
<FieldTextInput
|
||||
id="streetAddress"
|
||||
|
|
|
|||
|
|
@ -78,13 +78,13 @@ const PayoutDetailsFormCompanyComponent = ({ fieldRenderProps }) => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div className={css.sectionContainer}>
|
||||
<h3 className={css.subTitle}>
|
||||
<FormattedMessage id="PayoutDetailsForm.companyAddressTitle" />
|
||||
</h3>
|
||||
|
||||
<PayoutDetailsAddress country={country} intl={intl} disabled={disabled} form={form} />
|
||||
</div>
|
||||
<PayoutDetailsAddress
|
||||
country={country}
|
||||
intl={intl}
|
||||
disabled={disabled}
|
||||
form={form}
|
||||
companyAddress
|
||||
/>
|
||||
|
||||
<div className={css.sectionContainer}>
|
||||
<h3 className={css.subTitle}>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue