Added poetry picture, fixed spacing on UserPage
This commit is contained in:
parent
6478b45301
commit
fa98b392a8
@ -7,7 +7,7 @@ function Poetry() {
|
|||||||
const poetry = usePoetry()
|
const poetry = usePoetry()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<section>
|
||||||
<h4 className='fw-bold'>Поэзия</h4> {
|
<h4 className='fw-bold'>Поэзия</h4> {
|
||||||
gotResponse(poetry) ? (
|
gotResponse(poetry) ? (
|
||||||
gotError(poetry) ? (
|
gotError(poetry) ? (
|
||||||
@ -26,6 +26,7 @@ function Poetry() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<p><em>{poetry.data.author}</em></p>
|
<p><em>{poetry.data.author}</em></p>
|
||||||
|
<img src={`/poem_pic/${poetry.data.id}`} alt='Иллюстрация' />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
) : (
|
) : (
|
||||||
@ -33,7 +34,7 @@ function Poetry() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
</div>
|
</section>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,9 +7,6 @@ type PointsProps = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const styles = {
|
const styles = {
|
||||||
container: {
|
|
||||||
paddingBottom: 8,
|
|
||||||
} as CSSProperties,
|
|
||||||
points: {
|
points: {
|
||||||
float: 'right',
|
float: 'right',
|
||||||
} as CSSProperties,
|
} as CSSProperties,
|
||||||
@ -22,18 +19,16 @@ const styles = {
|
|||||||
|
|
||||||
function Points({ points }: PointsProps) {
|
function Points({ points }: PointsProps) {
|
||||||
return (
|
return (
|
||||||
<div style={styles.container}>
|
<h5>
|
||||||
<h5>
|
Набрано очков:
|
||||||
Набрано очков:
|
<span style={styles.points}>
|
||||||
<span style={styles.points}>
|
<img
|
||||||
<img
|
style={styles.icon}
|
||||||
style={styles.icon}
|
src={handStarsIcon}
|
||||||
src={handStarsIcon}
|
alt='Иконка руки, дающей звёзды' />
|
||||||
alt='Иконка руки, дающей звёзды' />
|
{points}
|
||||||
{points}
|
</span>
|
||||||
</span>
|
</h5>
|
||||||
</h5>
|
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ const styles = {
|
|||||||
objectFit: 'contain',
|
objectFit: 'contain',
|
||||||
borderRadius: 12,
|
borderRadius: 12,
|
||||||
marginBottom: 5,
|
marginBottom: 5,
|
||||||
|
maxWidth: 'inherit',
|
||||||
} as CSSProperties,
|
} as CSSProperties,
|
||||||
title: {
|
title: {
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
|
@ -26,15 +26,15 @@ function UserPage() {
|
|||||||
<SignOut />
|
<SignOut />
|
||||||
</BackHeader>
|
</BackHeader>
|
||||||
|
|
||||||
<Points points={
|
<div className='mb-4'>
|
||||||
gotResponse(user) ? (
|
<Points points={
|
||||||
gotError(user) ? -1 : user.data?.points
|
gotResponse(user) ? (
|
||||||
) : (
|
gotError(user) ? -1 : user.data?.points
|
||||||
'Загрузка...'
|
) : (
|
||||||
)
|
'Загрузка...'
|
||||||
} />
|
)
|
||||||
|
} />
|
||||||
|
|
||||||
<div>
|
|
||||||
<h5 className={styles.userRating}>
|
<h5 className={styles.userRating}>
|
||||||
Ваша оценка:
|
Ваша оценка:
|
||||||
<StarRating userId={user.data?.id || 1} />
|
<StarRating userId={user.data?.id || 1} />
|
||||||
@ -45,7 +45,9 @@ function UserPage() {
|
|||||||
<CategoryPreview key={cat} category={cat} />
|
<CategoryPreview key={cat} category={cat} />
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<Poetry />
|
<div className='mb-3'>
|
||||||
|
<Poetry />
|
||||||
|
</div>
|
||||||
</Container>
|
</Container>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
white-space: 'pre-wrap';
|
white-space: pre-wrap;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user