forked from polka_billy/porridger
Implemented UserPage
This commit is contained in:
@ -1,9 +1,26 @@
|
||||
import { Link } from 'react-router-dom'
|
||||
import { Container } from 'react-bootstrap'
|
||||
|
||||
import BackHeader from '../components/BackHeader'
|
||||
import { useUser } from '../hooks/api'
|
||||
import { userCategories } from '../assets/userCategories'
|
||||
import { CategoryPreview } from '../components'
|
||||
import { gotError } from '../hooks/useFetch'
|
||||
|
||||
function UserPage() {
|
||||
/* TODO */
|
||||
const user = useUser()
|
||||
|
||||
return <h1>For Yet Go <Link to='/'>Home</Link></h1>
|
||||
return (
|
||||
<Container style={{ maxWidth: 'calc(100vh*9/16)' }}>
|
||||
<BackHeader text={
|
||||
gotError(user) ?
|
||||
user.error :
|
||||
`${user.data.name}, с нами с ${new Date(user.data.regDate).toLocaleDateString('ru')}`
|
||||
} />
|
||||
{userCategories.map(cat => (
|
||||
<CategoryPreview key={cat} category={cat} />
|
||||
))}
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
|
||||
export default UserPage
|
||||
|
Reference in New Issue
Block a user