I have a dialog that is reusable. I have just ONE dialog for confirmation in logging out and for deleting.
My problem is on the logging out, once i confirm the logout, the action that is firing is the deletion.
I have put a console.log console.log("SUCCESS LOGOUT") console.log("DELETE USER SUCCESS"); to see if what action successfully fires and its the delete action. How will i fix this? Thank you.
SEE THIS LINK
Dialog
const ReusableDialog = ({
title,
details,
open,
type,
onAgree,
onDisagree
}) => {
return (
<div>
<Dialog
open={open}
TransitionComponent={Transition}
keepMounted
onClose={onDisagree}
aria-labelledby="alert-dialog-slide-title"
aria-describedby="alert-dialog-slide-description"
>
<DialogTitle id="alert-dialog-slide-title">
<span>
Are you sure you want to {title} {details?.name}
</span>
</DialogTitle>
<DialogActions>
<Button variant="contained" size="small" onClick={onDisagree}>
Cancel
</Button>
<Button variant="contained" size="small" onClick={onAgree}>
Confirm
</Button>
</DialogActions>
</Dialog>
</div>
);
};
export default ReusableDialog;