Skip to content

Commit

Permalink
feat: added text override on CheckoutActionComplete
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 Nov 21, 2019
1 parent 4808ec2 commit 65e9a4b
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ const ActionButton = styled.div`

class CheckoutActionComplete extends Component {
static propTypes = {
/**
* The text for the "Change" button text.
*/
changeButtonText: 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 @@ -91,10 +95,14 @@ class CheckoutActionComplete extends Component {
stepNumber: PropTypes.number
};

static defaultProps = {
changeButtonText: "Change"
}

handleOnChange = () => this.props.onClickChangeButton();

render() {
const { className, components: { Button }, content, label, stepNumber } = this.props;
const { className, components: { Button }, content, label, stepNumber, changeButtonText } = this.props;

const step = stepNumber ? <Fragment>{stepNumber}.&nbsp;</Fragment> : null;

Expand All @@ -107,7 +115,7 @@ class CheckoutActionComplete extends Component {
{content}
</ActionDetail>
<ActionButton>
<Button actionType="important" onClick={this.handleOnChange} isShortHeight isTextOnly>Change</Button>
<Button actionType="important" onClick={this.handleOnChange} isShortHeight isTextOnly>{changeButtonText}</Button>
</ActionButton>
</ActionContainer>
);
Expand Down

0 comments on commit 65e9a4b

Please sign in to comment.