Repository navigation
DRY iou prop types and default props #25961
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
Changes from all commits
24d136c
4d019dc
57cd981
86dba56
081a80c
bd840bd
4cbb254
a9a404e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import PropTypes from 'prop-types'; | ||
| import CONST from '../../../CONST'; | ||
| import participantPropTypes from '../../../components/participantPropTypes'; | ||
|
|
||
| const iouPropTypes = PropTypes.shape({ | ||
| /** ID (iouType + reportID) of the request */ | ||
| id: PropTypes.string, | ||
|
|
||
| /** Amount of the request */ | ||
| amount: PropTypes.number, | ||
|
|
||
| /** Currency of the request */ | ||
| currency: PropTypes.string, | ||
|
|
||
| /** Description of the request */ | ||
| comment: PropTypes.string, | ||
|
|
||
| /** The merchant name */ | ||
| merchant: PropTypes.string, | ||
|
|
||
| /** Date that the request was created */ | ||
| created: PropTypes.string, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this one is "Date that the request was created"
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. Any idea for the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can probably use the same description as
In the context of "manual request", the merchant doesn't really make much sense. It looks like we provide a "merchant" field, but never a description or directions on how to use it (from a consumer perspective).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I still don't understand what is merchant for haha. Updated the comment. |
||
|
|
||
| /** The path to an image of the receipt attached to the request */ | ||
| receiptPath: PropTypes.string, | ||
|
bernhardoj marked this conversation as resolved.
Resolved
|
||
|
|
||
| /** List of the participants */ | ||
| participants: PropTypes.arrayOf(participantPropTypes), | ||
| }); | ||
|
|
||
| const iouDefaultProps = { | ||
| id: '', | ||
| amount: 0, | ||
| currency: CONST.CURRENCY.USD, | ||
| comment: '', | ||
| merchant: '', | ||
| created: '', | ||
| participants: [], | ||
| receiptPath: '', | ||
| }; | ||
|
|
||
| export {iouPropTypes, iouDefaultProps}; | ||

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 ran the lint locally and found that iou prop is not exist here