komap_backup/front/components/UserHeader.tsx

30 lines
614 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { UserContext } from "context/user";
import Link from "next/link";
import React, { useContext } from "react";
const UserHeader: React.FC = () => {
const user = useContext(UserContext);
return (
<>
<div>Очки: {user?.userState?.points || 0}</div>
<nav>
<ul>
<li>
<Link href="/profile">
<a>Профиль</a>
</Link>
</li>
<li>
<Link href="/achivements">
<a>Ачивки</a>
</Link>
</li>
</ul>
</nav>
</>
);
};
export default UserHeader;