| const ProfileControl = (props) => { | const ProfileControl = (props) => { | ||||
| const dispatch = useDispatch(); | const dispatch = useDispatch(); | ||||
| const removeUser = () => { | |||||
| const removeUser = (event) => { | |||||
| event.stopPropagation(); | |||||
| dispatch( | dispatch( | ||||
| toggleDeleteCategoryModal({ | toggleDeleteCategoryModal({ | ||||
| customId: props.profile?._id, | customId: props.profile?._id, | ||||
| }) | }) | ||||
| ); | ); | ||||
| }; | }; | ||||
| const blockUser = () => { | |||||
| const blockUser = (event) => { | |||||
| event.stopPropagation(); | |||||
| dispatch( | dispatch( | ||||
| toggleDeleteCategoryModal({ | toggleDeleteCategoryModal({ | ||||
| customId: props.profile?._id, | customId: props.profile?._id, | ||||
| }) | }) | ||||
| ); | ); | ||||
| }; | }; | ||||
| const unblockUser = () => { | |||||
| const unblockUser = (event) => { | |||||
| event.stopPropagation(); | |||||
| dispatch( | dispatch( | ||||
| toggleDeleteCategoryModal({ | toggleDeleteCategoryModal({ | ||||
| customId: props.profile?._id, | customId: props.profile?._id, | ||||
| }) | }) | ||||
| ); | ); | ||||
| }; | }; | ||||
| const handleEditProfile = () => { | |||||
| console.log("edit") | |||||
| console.log(props) | |||||
| const handleEditProfile = (event) => { | |||||
| event.stopPropagation(); | |||||
| console.log("edit"); | |||||
| console.log(props); | |||||
| if (!props.profile?._blocked || props?.isAdmin) { | if (!props.profile?._blocked || props?.isAdmin) { | ||||
| console.log("edit2") | |||||
| console.log("edit2"); | |||||
| dispatch( | dispatch( | ||||
| toggleEditProfileModal({ | toggleEditProfileModal({ | ||||
| userId: props.profile._id, | userId: props.profile._id, | ||||
| ); | ); | ||||
| } | } | ||||
| }; | }; | ||||
| console.log(props) | |||||
| console.log(props); | |||||
| return ( | return ( | ||||
| <ButtonsContainer> | <ButtonsContainer> | ||||
| {props.profile?._blocked && !props.isMobile && !props?.isAdmin && <BlockedProfile />} | |||||
| {props.profile?._blocked && !props.isMobile && !props?.isAdmin && ( | |||||
| <BlockedProfile /> | |||||
| )} | |||||
| {props.isAdmin && ( | {props.isAdmin && ( | ||||
| <> | <> | ||||
| {props.profile?._blocked ? ( | {props.profile?._blocked ? ( |