Files
parcer/ui/src/components/Topbar/index.jsx

63 lines
1.9 KiB
React
Raw Normal View History

2024-03-07 02:47:47 +05:30
import { useState } from "react";
import { Layout, Menu, Col, Drawer } from "antd";
2024-03-07 03:00:47 +05:30
import { Link } from "react-router-dom";
2024-03-07 02:43:22 +05:30
import { FaBars } from "react-icons/fa";
2024-03-07 02:29:43 +05:30
const { Header } = Layout;
const Topbar = () => {
2024-03-07 02:47:47 +05:30
const [visible, setVisible] = useState(false);
const showDrawer = () => setVisible(true);
const hideDrawer = () => setVisible(false);
2024-03-07 02:29:43 +05:30
return (
2024-03-07 03:34:40 +05:30
<Header className="flex justify-between items-center h-16 bg-white shadow-md">
2024-03-07 02:29:43 +05:30
<Col span={4} className="flex items-center">
<Link to="/">
2024-03-07 02:31:00 +05:30
<img src="maxun_logo.png" alt="Maxun" className="h-8 w-auto" />
2024-03-07 02:29:43 +05:30
</Link>
</Col>
<Col span={16} className="hidden lg:flex justify-end">
<Menu mode="horizontal">
<Menu.Item key="1">
2024-03-07 02:49:27 +05:30
<Link to="/dashboard">Dashboard</Link>
2024-03-07 02:29:43 +05:30
</Menu.Item>
<Menu.Item key="2">
2024-03-07 02:49:27 +05:30
<Link to="/credits">Credits</Link>
2024-03-07 02:29:43 +05:30
</Menu.Item>
<Menu.Item key="3">
2024-03-07 03:11:26 +05:30
<Link to="/profile">Profile</Link>
2024-03-07 02:29:43 +05:30
</Menu.Item>
</Menu>
</Col>
<Col span={4} className="lg:hidden flex justify-end">
2024-03-14 01:41:53 +05:30
<FaBars className="text-2xl text-gray-600" onClick={showDrawer} />
2024-03-07 02:29:43 +05:30
</Col>
2024-03-07 02:48:16 +05:30
<Drawer
title="Navigation"
placement="right"
closable={false}
onClose={hideDrawer}
open={visible}
2024-03-07 03:00:26 +05:30
getContainer={() => document.body} // Ensure the drawer covers viewport on mobile
2024-03-07 02:48:16 +05:30
>
<Menu mode="vertical">
2024-03-07 03:00:26 +05:30
<Menu.Item key="1">
2024-03-07 03:00:47 +05:30
<Link to="/dashboard" onClick={hideDrawer}>
Dashboard
</Link>
2024-03-07 02:48:16 +05:30
</Menu.Item>
<Menu.Item key="2">
2024-03-07 03:00:26 +05:30
<Link to="/credits" onClick={hideDrawer}>Credits</Link>
2024-03-07 02:48:16 +05:30
</Menu.Item>
<Menu.Item key="3">
2024-03-07 03:11:26 +05:30
<Link to="/profile" onClick={hideDrawer}>Profile</Link>
2024-03-07 02:48:16 +05:30
</Menu.Item>
</Menu>
</Drawer>
2024-03-07 02:29:43 +05:30
</Header>
);
};
export default Topbar;