diff --git a/src/components/ProfileSheltersBlock/ProfileSheltersBlock.jsx b/src/components/ProfileSheltersBlock/ProfileSheltersBlock.jsx index 7f59f8b5..4bad37e6 100644 --- a/src/components/ProfileSheltersBlock/ProfileSheltersBlock.jsx +++ b/src/components/ProfileSheltersBlock/ProfileSheltersBlock.jsx @@ -1,15 +1,16 @@ -import React from 'react'; +import React, { useContext } from 'react'; import { useNavigate } from 'react-router-dom'; import './ProfileSheltersBlock.scss'; import ShelterCard from '../ShelterCard/ShelterCard'; import Button from '../../ui/Button/Button'; +import CurrentUserContext from '../../contexts/CurrentUserContext'; const ProfileSheltersBlock = ({ myShelters, sheltersTitle }) => { + const { own_shelter } = useContext(CurrentUserContext); const navigate = useNavigate(); - return (
- {myShelters && myShelters.length !== 0 && + {myShelters && myShelters.length !== 0 && (

{sheltersTitle}

@@ -31,12 +32,18 @@ const ProfileSheltersBlock = ({ myShelters, sheltersTitle }) => { ); })} - {myShelters && } + {myShelters && ( + + )}
- } + )}
); };