-
Notifications
You must be signed in to change notification settings - Fork 942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add stripe business accounts #980
Conversation
b50df40
to
8b16f86
Compare
disabled: bool, | ||
fieldId: string, | ||
|
||
// from injectIntl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw. this is a bit confusing comment since there is no injectIntl (higher order component) used in this file.
.root { | ||
} | ||
|
||
.formRow { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not used.
margin-bottom: 24px; | ||
} | ||
|
||
.field { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this is not used either.
.field { | ||
width: 100%; | ||
} | ||
.buttonsWrapper button { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used in the example only. (We try to keep example/styleguide CSS out of main component CSS by having separate ComponentName.example.css file).
Another thing to note: we don't want to refer to elements anywhere except in marketplaceIndex.css file - add classes instead.
const classes = classNames(rootClassName || css.root, className); | ||
|
||
return ( | ||
<FieldArray id={id} name={name} className={classes}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I don't think it makes much sense for this to exists as a separate component (FieldArray wrapper for FieldArray). There are no styles attached to this component (and the styles are likely to be different in different use scenarios when import { FieldArray } from 'react-final-form-arrays';
is used.
It is also good to note that every time, when FieldArrays are used inside Final Form, the form needs to pass arrayMutators
as props to the FinalForm component itself. So, wrapping the usage of react-final-form-arrays
library with separate component like this one might be a bit confusing since it doesn't work out of the box.
const classes = classNames(rootClassName || css.root, className); | ||
|
||
// Use given size as width and height or default to 12px | ||
const svgSize = size ? size : 12; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a bit of catch when sizing SVG icons with width and height. They render graphics (paths, rects, circles etc.) to their own inner viewbox (or should I say coordinate system).
There's one problem with this concept related to line graphics: if the width of the icon is scaled down, also the line width is scaled down accordingly. So, it is unlikely that the width of the line matches with the width our designer intended it to be. (This is the reason why we have different SVG graphics for different sizes in IconArrowHead.js
payoutDetailValues = payoutDetails['company']; | ||
} else if (accountType === 'individual') { | ||
payoutDetailValues = payoutDetails['individual']; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is OK but can be achieved with ternary too.
id: 'PayoutDetailsForm.firstNameRequired', | ||
}) | ||
); | ||
const { country } = values; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could extract accountType here too since it is used later.
/> | ||
</div> | ||
{values.accountType ? ( | ||
<React.Fragment> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
const hasAdditionalOwners = values.company && values.company.additionalOwners; | ||
const hasMaxNumberOfAdditionalOwners = | ||
hasAdditionalOwners && values.company.additionalOwners.length >= 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to use magic numbers in the code. So, I'd suggest that this number is either
- coming from config:
maxNumberOfAdditionalOwners
(might be unnecessary if the value is just 4 or nothing) or - it is a constant defined at the beginning of this file:
// In EU, there can be a maximum of 4 additional owners
const MAX_NUMBER_OF_ADDITIONAL_OWNERS = 4;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it how much easier this is to read and configure after separating individual and company sections and adding more sub components.
I added quite many change request related to code-conventions we use (and pointed some unused code), but actually, this looks pretty good 👍
887b4de
to
0a35c58
Compare
e6f88a5
to
be64212
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, check Janne's opinion before merging
be64212
to
40e2695
Compare
d2924ca
to
2d64a5a
Compare
…etailsFormCompany
2d64a5a
to
d22da25
Compare
PayoutDetailsForm
is now divided to multiple smaller subcomponents:PayoutDetailsCompany
andPayoutDetailsIndividual
contain needed fields for individual and company accountsPayoutDetailsAddress
,PayoutDetailsBankDetails
andPayoutDetailsPersonalDetails
specific fields related to address, bank details and personal detailsNew
FieldArray
component is created for adding multiple additional owners if needed.Select individual or company account
Add additional owners