Reputation: 55
swal({
title: `Are you sure to delete this news posted by ${news.users.user_name} ?`,
text: `Once deleted, you will not be able to recover this post!`,
icon: "warning",
buttons: true,
dangerMode: true,
}).then(willDelete => {
if (willDelete) {
this.props.deleteNewsPosts(news._id)
} else {
swal(`This news is safe!`)
}
})
}
Upvotes: 2
Views: 7978
Reputation: 1531
Try using CSS on the .swal-button class (if you want it to be more specific you can pass a classname property to that alert or to the buttons as described here: https://sweetalert.js.org/docs/#configuration)
Upvotes: 2