Skip to content

Commit

Permalink
feat: added label overrides on AddressCapture
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 f513d8b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions package/src/components/AddressCapture/v1/AddressCapture.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ class AddressCapture extends Component {
*/
AddressReview: CustomPropTypes.component.isRequired
}).isRequired,
/**
* The text for the "Edit entered address" text, if it is shown.
*/
editButtonText: PropTypes.string,
/**
* Is data being saved
*/
Expand All @@ -120,6 +124,7 @@ class AddressCapture extends Component {
addressEntered: null,
addressSuggestion: null
},
editButtonText: "Edit entered address",
isSaving: false
};

Expand Down Expand Up @@ -268,7 +273,7 @@ class AddressCapture extends Component {
}

renderReview() {
const { addressReviewProps, components: { AddressReview, Button }, isSaving } = this.props;
const { addressReviewProps, components: { AddressReview, Button }, editButtonText, isSaving } = this.props;
return (
<Fragment>
<AddressReview {...addressReviewProps} ref={this.formRef} isSaving={isSaving} onSubmit={this.handleSubmit} />
Expand All @@ -278,7 +283,7 @@ class AddressCapture extends Component {
this.toggleStatus = EDIT;
}}
>
Edit entered address
{editButtonText}
</Button>
</Fragment>
);
Expand Down

0 comments on commit f513d8b

Please sign in to comment.