Skip to content

Commit

Permalink
feat: added label overrides on AccountProfileInfo
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 b84ebaf
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ class AccountProfileInfo extends Component {
*/
ProfileImage: PropTypes.oneOfType([PropTypes.string, PropTypes.func])
}),
/**
* The text for the "Edit Account" text, if it is shown.
*/
editAccountButtonText: PropTypes.string,
/**
* Function to pass to button onClick
*/
Expand All @@ -75,6 +79,7 @@ class AccountProfileInfo extends Component {
};

static defaultProps = {
editAccountButtonText: "Edit Account",
shouldShowEditButton: false
};

Expand Down Expand Up @@ -104,11 +109,11 @@ class AccountProfileInfo extends Component {
}

viewerProfileEditLink = () => {
const { components: { Button }, onClickEdit, shouldShowEditButton } = this.props;
const { components: { Button }, onClickEdit, shouldShowEditButton, editAccountButtonText } = this.props;

if (shouldShowEditButton) {
return (
<Button isShortHeight isTextOnly isTextOnlyNoPadding onClick={onClickEdit}>Edit Account</Button>
<Button isShortHeight isTextOnly isTextOnlyNoPadding onClick={onClickEdit}>{editAccountButtonText}</Button>
);
}
return null;
Expand Down

0 comments on commit b84ebaf

Please sign in to comment.