Blame view

components/layout/VendorDashboardSidebar.js 2.35 KB
jaymehta committed
1
import Image from "next/image";
jaymehta committed
2
import Link from "next/link";
jaymehta committed
3 4 5 6
import { useRouter } from "next/router";
import React, { useState } from "react";
import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
7
const Sidebar = () => {
jaymehta committed
8 9 10
  const router = useRouter();

  const [collapsed, setCollapsed] = useState(false);
11

jaymehta committed
12 13 14
  const toggleSidebar = () => {
    setCollapsed(!collapsed);
  };
15

jaymehta committed
16 17 18
  return (
    <div className={`sidebar ${collapsed ? "collapsed" : ""}`}>
      <ToastContainer position="bottom-right"></ToastContainer>
19

jaymehta committed
20
      {/* <button className="toggle-btn" onClick={toggleSidebar}>
21 22
        Toggle Sidebar
      </button> */}
jaymehta committed
23 24
      <ul>
        <li className={router.pathname === "/vendor/dashboard" ? "active" : ""}>
Chetan committed
25 26 27 28 29 30 31 32
          <Link href="/vendor/dashboard">
            <span className="d-flex cursor-pointer">
              <Image className="" alt="" width={22} height={15} src="/images/vendor/icon-dashboard.svg" />
              <div className="mx-2 text-center">
                Dashboard
              </div>
            </span>
          </Link>
jaymehta committed
33
        </li>
jaymehta committed
34
        <li className={router.pathname === "/vendor/enquiries" ? "active" : ""}>
Chetan committed
35 36 37 38 39 40 41 42
          <Link href="/vendor/enquiries">
            <span className="d-flex cursor-pointer">
              <Image alt="" width={22} height={15} src="/images/vendor/icon-orders.svg" />
              <div className="mx-2 text-center">
                Enquiries
              </div>
            </span>
          </Link>
jaymehta committed
43 44
        </li>
        <li className={router.pathname === "/vendor/activities" ? "active" : ""}>
Chetan committed
45 46 47 48 49 50 51 52
          <Link href="/vendor/activities">
            <span className="d-flex cursor-pointer">
              <Image alt="" width={22} height={15} src="/images/vendor/icon-activities.svg" />
              <div className="mx-2 text-center">
                Activities
              </div>
            </span>
          </Link>
jaymehta committed
53
        </li>
.  
jaymehta committed
54
        <li className={router.pathname === "/vendor/reviews" ? "active" : ""}>
Chetan committed
55 56 57 58 59 60 61 62
          <Link href="/vendor/reviews">
            <span className="d-flex cursor-pointer">
              <Image alt="" width={22} height={15} src="/images/vendor/icon-orders.svg" />
              <div className="mx-2 text-center">
                Reviews
              </div>
            </span>
          </Link>
.  
jaymehta committed
63
        </li>
jaymehta committed
64 65 66
      </ul>
    </div>
  );
67 68
};

jaymehta committed
69
export default Sidebar;