djorg83 / react-bootstrap-sweetalert

A React implementation of SweetAlert
https://djorg83.github.io/react-bootstrap-sweetalert/
MIT License
253 stars 55 forks source link

Support re-ordering of buttons #34

Closed rezavation closed 4 years ago

rezavation commented 5 years ago

Currently the Buttons.js doesn't allow for the Cancel and Confirm buttons to be re-ordered. It assumes that if this.props.showConfirm === true and this.props.showCancel === true that it should render the Cancel button first and then the Confirm button. This should be a relatively easy fix if we just want to solve for consumers re-ordering the buttons. If we want to support further customization, we could potentially use a render prop.

djorg83 commented 5 years ago

You could hide both buttons and render you own buttons within the sweet alert content. I'll see about using render props of some other sort of customization for the buttons

wouter140 commented 4 years ago

I added support for re-ordering in PR #51 with the reverseButtons property, like swal has it. I also added the option to fully customize the actions with the customActions property.