blob: 93a3864269765773adf391cfea1b373c5f9047f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import React from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { closeDeleteProfileModal } from '../../actions/modals/profile'
import { deleteCurrentUser } from '../../actions/users'
import ConfirmationModal from '../../components/modals/ConfirmationModal'
const DeleteProfileModal = () => {
const visible = useSelector((state) => state.modals.deleteProfileModalVisible)
const dispatch = useDispatch()
const callback = (isConfirmed) => {
if (isConfirmed) {
dispatch(deleteCurrentUser())
}
dispatch(closeDeleteProfileModal())
}
return (
<ConfirmationModal
title="Delete my account"
message="Are you sure you want to delete your OpenDC account?"
show={visible}
callback={callback}
/>
)
}
export default DeleteProfileModal
|