plane/apps/app/layouts/Navbar/DefaultTopBar.tsx

32 lines
875 B
TypeScript
Raw Normal View History

2022-11-19 14:21:26 +00:00
import React from "react";
// next js
import Link from "next/link";
// hooks
import useUser from "lib/hooks/useUser";
const DefaultTopBar: React.FC = () => {
const { user } = useUser();
return (
<div className="flex justify-between items-center px-4 h-16 sm:px-6 md:justify-start md:space-x-10 absolute top-0 w-full">
<div className="w-full flex items-center justify-between">
<div>
<Link href="/" className="flex">
<span className="sr-only">Plane</span>
<h2 className="text-2xl font-semibold">
Plan<span className="text-indigo-600">e</span>
</h2>
2022-11-19 14:21:26 +00:00
</Link>
</div>
{user && (
<div>
<p className="text-sm text-gray-500">logged in as {user.first_name}</p>
2022-11-19 14:21:26 +00:00
</div>
)}
</div>
</div>
);
};
export default DefaultTopBar;