Refactored Rating component

Separated annDetails, added to userPage, made actually operating
This commit is contained in:
2023-08-08 18:36:47 +03:00
parent f432193508
commit d9925647c6
9 changed files with 124 additions and 114 deletions

View File

@ -2,7 +2,7 @@ import { Container } from 'react-bootstrap'
import { useUser } from '../hooks/api'
import { userCategories } from '../assets/userCategories'
import { BackHeader, CategoryPreview, Poetry, Points, SignOut } from '../components'
import { BackHeader, CategoryPreview, Poetry, Points, SignOut, StarRating } from '../components'
import { gotError, gotResponse } from '../hooks/useFetch'
import styles from '../styles/UserPage.module.css'
@ -34,6 +34,13 @@ function UserPage() {
)
} />
<div>
<h5 className={styles.userRating}>
Ваша оценка:
<StarRating userId={user.data?.id || 1} />
</h5>
</div>
{userCategories.map(cat => (
<CategoryPreview key={cat} category={cat} />
))}