Skip to content

Commit

Permalink
feat: added label overrides on AddressReview
Browse files Browse the repository at this point in the history
Signed-off-by: Haris Spahija <haris.spahija@pon.com>
  • Loading branch information
HarisSpahijaPon committed Oct 28, 2019
1 parent 4808ec2 commit 8d8467f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions package/src/components/AddressReview/v1/AddressReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ class AddressReview extends Component {
* Address entered
*/
addressEntered: CustomPropTypes.address.isRequired,
/**
* The text for the "Address Name" label text.
*/
addressEnteredLabelText: PropTypes.string,
/**
* Address validations address suggestion
*/
addressSuggestion: CustomPropTypes.address.isRequired,
/**
* The text for the "Suggested Address" label text.
*/
addressSuggestionLabelText: PropTypes.string,
/**
* You can provide a `className` prop that will be applied to the outermost DOM element
* rendered by this component. We do not recommend using this for styling purposes, but
Expand Down Expand Up @@ -66,6 +74,8 @@ class AddressReview extends Component {
};

static defaultProps = {
addressEnteredLabelText: "Entered Address",
addressSuggestionLabelText: "Suggested Address",
isSaving: false,
value: SUGGESTED
};
Expand Down Expand Up @@ -142,7 +152,9 @@ class AddressReview extends Component {
render() {
const {
addressEntered,
addressEnteredLabelText,
addressSuggestion,
addressSuggestionLabelText,
className,
components: { Address, SelectableList },
isSaving,
Expand All @@ -158,13 +170,13 @@ class AddressReview extends Component {
invalidAddressProperties={this.invalidAddressProperties}
/>
),
label: "Entered Address:",
label: `${addressEnteredLabelText}:`,
value: ENTERED
},
{
id: `${SUGGESTED}_${this.uniqueInstanceIdentifier}`,
detail: <Address address={this.xformAddress(addressSuggestion)} />,
label: "Suggested Address:",
label: `${addressSuggestionLabelText}:`,
value: SUGGESTED
}
];
Expand Down

0 comments on commit 8d8467f

Please sign in to comment.