Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change button names #107

Closed
Gfast2 opened this issue Apr 24, 2018 · 1 comment
Closed

Change button names #107

Gfast2 opened this issue Apr 24, 2018 · 1 comment

Comments

@Gfast2
Copy link

Gfast2 commented Apr 24, 2018

Hi chentsulin,

Big Thanks again for your efforts to bring out such a poetry touch of the very popular Sweet-Alert to the React Planet! 馃尡 馃審 Since I'm using React & Sweetalert for my production repos. I've implemented this repo as connector between this two libraries.

No Big Deal, just drop by to thank you and ask you this small question:

How to change the name of the button?

I've checked out your sweetalert-react/src/SweetalertAlert.js wrapper. Because of the lack of expirences, I believe I saw nothing... 馃檲 It's not that important really. But it would be a nice to have Know-How

@Gfast2
Copy link
Author

Gfast2 commented Apr 24, 2018

Yoh, This is actually really simple:

SweetAlert.defaultProps = {
  // sweetalert option
  text: null,
  type: null,
  customClass: null,
  showCancelButton: false,
  showConfirmButton: true,
  confirmButtonText: 'OK',
  confirmButtonColor: '#aedef4',
  cancelButtonText: 'Cancel',
  imageUrl: null,
  imageSize: '80x80',
  html: false,
  animation: true,
  inputType: 'text',
  inputPlaceholder: null,
  inputValue: null,
  showLoaderOnConfirm: false,

  // custom option
  show: false
};

So what works for me: In order to change the cancel Button name, just define that with cancelButtonText: 'Cancel Button' 馃尫

@Gfast2 Gfast2 closed this as completed Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant