manifold/web/components/nav/profile-menu.tsx

26 lines
845 B
TypeScript
Raw Normal View History

import Link from 'next/link'
import { User } from 'web/lib/firebase/users'
import { formatMoney } from 'common/util/format'
2022-03-17 07:50:45 +00:00
import { Avatar } from '../avatar'
import { trackCallback } from 'web/lib/service/analytics'
export function ProfileSummary(props: { user: User }) {
const { user } = props
return (
2022-09-27 21:16:48 +00:00
<Link href={`/${user.username}?tab=portfolio`}>
<a
onClick={trackCallback('sidebar: profile')}
className="group mb-3 flex flex-row items-center gap-4 truncate rounded-md py-3 text-gray-500 hover:bg-gray-100 hover:text-gray-700"
>
<Avatar avatarUrl={user.avatarUrl} username={user.username} noLink />
2022-01-27 23:24:44 +00:00
<div className="truncate">
<div>{user.name}</div>
<div className="text-sm">{formatMoney(Math.floor(user.balance))}</div>
2022-01-08 18:14:20 +00:00
</div>
</a>
</Link>
)
}