stacker.news/components/user-header.js

32 lines
902 B
JavaScript
Raw Normal View History

2021-04-22 22:14:32 +00:00
import Link from 'next/link'
import { useRouter } from 'next/router'
import Nav from 'react-bootstrap/Nav'
export default function UserHeader ({ user }) {
const router = useRouter()
return (
<>
<h1>@{user.name} <small className='text-success'>[{user.stacked} stacked, {user.sats} sats]</small></h1>
<Nav
activeKey={router.asPath}
>
<Nav.Item>
<Link href={'/' + user.name} passHref>
<Nav.Link>{user.nitems} posts</Nav.Link>
</Link>
</Nav.Item>
<Nav.Item>
<Link href={'/' + user.name + '/comments'} passHref>
<Nav.Link>{user.ncomments} comments</Nav.Link>
</Link>
</Nav.Item>
2021-05-11 15:52:50 +00:00
{/* <Nav.Item>
2021-04-22 22:14:32 +00:00
<Link href={'/' + user.name + '/sativity'} passHref>
<Nav.Link>sativity</Nav.Link>
</Link>
2021-05-11 15:52:50 +00:00
</Nav.Item> */}
2021-04-22 22:14:32 +00:00
</Nav>
</>
)
}