fix:отображение описания пользователей
This commit is contained in:
@@ -10,7 +10,7 @@ const OtherProfile = () => {
|
|||||||
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 [user_description, setUserDescription] = useState('');
|
const [description, setUserDescription] = useState('');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const checkSession = async () => {
|
const checkSession = async () => {
|
||||||
@@ -18,10 +18,10 @@ const OtherProfile = () => {
|
|||||||
const response = await axios.get('/api/users/' + id);
|
const response = await axios.get('/api/users/' + id);
|
||||||
setUser(response.data.display_name);
|
setUser(response.data.display_name);
|
||||||
setAvatar(response.data.avatar_url);
|
setAvatar(response.data.avatar_url);
|
||||||
if (response.data.user_description === '') {
|
if (response.data.description === '') {
|
||||||
setUserDescription('Описание отсутствует')
|
setUserDescription('Описание отсутствует')
|
||||||
} else {
|
} else {
|
||||||
setUserDescription(response.data.user_description);
|
setUserDescription(response.data.description);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError('Вы не авторизованы');
|
setError('Вы не авторизованы');
|
||||||
@@ -42,7 +42,7 @@ const OtherProfile = () => {
|
|||||||
<div className="user-name">{user}</div>
|
<div className="user-name">{user}</div>
|
||||||
<img className="profile-avatar" src={avatar} alt={''}/>
|
<img className="profile-avatar" src={avatar} alt={''}/>
|
||||||
</div>
|
</div>
|
||||||
<div className="user-description">{user_description}</div>
|
<div className="user-description">{description}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user