Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
piyushroshan committed Nov 18, 2024
1 parent 02a330d commit 4ce79a1
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions services/web/src/components/navBar/navBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
import "./nav.css";

import { Button, Dropdown, Menu, Avatar, Layout, Space } from "antd";
import { LogoutOutlined, EditOutlined, ProfileOutlined, CaretDownOutlined } from "@ant-design/icons";
import {
LogoutOutlined,
EditOutlined,
ProfileOutlined,
CaretDownOutlined,
} from "@ant-design/icons";
import React from "react";
import roleTypes from "../../constants/roleTypes";
import type { MenuProps } from 'antd';
import type { MenuProps } from "antd";
import { useNavigate } from "react-router-dom";
import { connect, ConnectedProps } from "react-redux";
import { logOutUserAction } from "../../actions/userActions";
Expand Down Expand Up @@ -68,9 +73,9 @@ const Navbar: React.FC<NavbarProps> = (props) => {
else if (input.key === "forum") navigate(`/forum`);
};

type MenuItem = Required<MenuProps>['items'][number];
type MenuItem = Required<MenuProps>["items"][number];

const menuitems: MenuItem[] = []
const menuitems: MenuItem[] = [];
menuitems.push({ key: "dashboard", label: "Dashboard" });
if (role !== roleTypes.ROLE_MECHANIC) {
menuitems.push({ key: "shop", label: "Shop" });
Expand All @@ -86,11 +91,26 @@ const Navbar: React.FC<NavbarProps> = (props) => {
/>
);

const sideMenuItems: MenuProps['items'] = [
{ key: "profile", label: "My Profile", onClick: () => navigate("/my-profile"), icon: <ProfileOutlined /> },
{ key: "password", label: "Change Password", onClick: () => navigate("/reset-password"), icon: <EditOutlined /> },
{ key: "logout", label: "Logout", onClick: logout, icon: <LogoutOutlined /> },
]
const sideMenuItems: MenuProps["items"] = [
{
key: "profile",
label: "My Profile",
onClick: () => navigate("/my-profile"),
icon: <ProfileOutlined />,
},
{
key: "password",
label: "Change Password",
onClick: () => navigate("/reset-password"),
icon: <EditOutlined />,
},
{
key: "logout",
label: "Logout",
onClick: logout,
icon: <LogoutOutlined />,
},
];

return (
<Header>
Expand Down

0 comments on commit 4ce79a1

Please sign in to comment.