Исправление ошибок в OtherProfile

This commit is contained in:
Dozzy7528
2026-02-03 13:54:10 +03:00
parent 87c3a5b400
commit 86f61d675b

View File

@@ -5,11 +5,11 @@ import axios from 'axios';
import Header from './Header'; import Header from './Header';
const OtherProfile = () => { const OtherProfile = () => {
const navigate = useNavigate();
const {id} = useParams(''); const {id} = useParams('');
const [user, setUser] = useState(null); const [user, setUser] = useState(null);
const [avatar, setAvatar] = useState(''); const [avatar, setAvatar] = useState('');
const [error, setError] = useState(''); const [error, setError] = useState('');
const navigate = useNavigate();
const [user_description, setUserDescription] = useState(''); const [user_description, setUserDescription] = useState('');
useEffect(() => { useEffect(() => {
@@ -31,7 +31,7 @@ const OtherProfile = () => {
} }
}; };
checkSession(); checkSession();
}, []); }, [id, navigate]);
return ( return (
<><Header/> <><Header/>
@@ -40,7 +40,7 @@ const OtherProfile = () => {
<div className="profile-info"> <div className="profile-info">
<div className="name-with-avatar"> <div className="name-with-avatar">
<div className="user-name">{user}</div> <div className="user-name">{user}</div>
<img className="profile-avatar" src={avatar}/> <img className="profile-avatar" src={avatar} alt={''}/>
</div> </div>
<div className="user-description">{user_description}</div> <div className="user-description">{user_description}</div>
</div> </div>