Selaa lähdekoodia

Fixed 2022

bugfix/2022
jovan.cirkovic 3 vuotta sitten
vanhempi
commit
d89f747d71

+ 15
- 9
src/components/Cards/ProfileCard/ProfileControl/ProfileControl.js Näytä tiedosto

@@ -21,7 +21,8 @@ import ProfileControlButton from "./ProfileControlButton/ProfileControlButton";

const ProfileControl = (props) => {
const dispatch = useDispatch();
const removeUser = () => {
const removeUser = (event) => {
event.stopPropagation();
dispatch(
toggleDeleteCategoryModal({
customId: props.profile?._id,
@@ -31,7 +32,8 @@ const ProfileControl = (props) => {
})
);
};
const blockUser = () => {
const blockUser = (event) => {
event.stopPropagation();
dispatch(
toggleDeleteCategoryModal({
customId: props.profile?._id,
@@ -42,7 +44,8 @@ const ProfileControl = (props) => {
})
);
};
const unblockUser = () => {
const unblockUser = (event) => {
event.stopPropagation();
dispatch(
toggleDeleteCategoryModal({
customId: props.profile?._id,
@@ -53,11 +56,12 @@ const ProfileControl = (props) => {
})
);
};
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) {
console.log("edit2")
console.log("edit2");
dispatch(
toggleEditProfileModal({
userId: props.profile._id,
@@ -70,10 +74,12 @@ const ProfileControl = (props) => {
);
}
};
console.log(props)
console.log(props);
return (
<ButtonsContainer>
{props.profile?._blocked && !props.isMobile && !props?.isAdmin && <BlockedProfile />}
{props.profile?._blocked && !props.isMobile && !props?.isAdmin && (
<BlockedProfile />
)}
{props.isAdmin && (
<>
{props.profile?._blocked ? (

Loading…
Peruuta
Tallenna