@eventeam/boot-alert-confirm
v1.0.6
Published
A confirmation modal with redux
Downloads
10
Readme
# BootAlert Confirm
Wrapper on reacstrap for easy confirmations in UI
Wherever you want to use the confirm:
import BootAlert from 'bootAlertConfirm';
<BootAlert />
Add to redux store
import { BootAlertReducer } from 'bootAlertConfirm';
const rootReducer = combineReducers({
...
confirmations: BootAlertReducer
...
});
then to use, add to async function
import { getConfirmation } from 'bootAlertConfirm';
return async function(dispatch, getState) {
const confirmation = {
title: 'Reset Form - Are you sure?',
message:
'This will completely reset the form, including all changes you have made.',
accepttext: 'Reset the form',
accepttype: 'danger',
rejecttext: 'Cancel ',
rejecttype: 'secondary'
};
const proceed = await dispatch(getConfirmation(confirmation));
if (proceed) {
// do stuff
}
}