Blame view

components/layout/AdminDashboardSidebar.js 2.14 KB
.  
jaymehta committed
1 2 3 4
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/router";
import React, { useState } from "react";
Jyotsna committed
5 6

const Sidebar = () => {
.  
jaymehta committed
7
  const router = useRouter();
Jyotsna committed
8

.  
jaymehta committed
9
  const [collapsed, setCollapsed] = useState(false);
Jyotsna committed
10

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

.  
jaymehta committed
15 16 17
  return (
    <div className={`sidebar ${collapsed ? "collapsed" : ""}`}>
      {/* <button className="toggle-btn" onClick={toggleSidebar}>
Jyotsna committed
18 19
        Toggle Sidebar
      </button> */}
.  
jaymehta committed
20 21
      <ul>
        {/* <li className={router.pathname === "/admin/orders" ? "active" : ""}>
Jyotsna committed
22 23 24 25
                    <a href="/admin/orders">
                        <Image alt="" width={22} height={15} src="/images/vendor/icon-orders.svg" />
                        <span>Orders</span>
                    </a>
.  
jaymehta committed
26
                </li> */}
.  
jaymehta committed
27 28
        <li className={router.pathname === "/admin/activities" ? "active" : ""}>
          <Link prefetch href="/admin/activities">
.  
jaymehta committed
29 30 31 32
            <div>
              <Image alt="" width={22} height={15} src="/images/vendor/icon-activities.svg" />
              <span>Activities</span>
            </div>
.  
jaymehta committed
33 34 35 36
          </Link>
        </li>
        <li className={router.pathname === "/admin/vendors" ? "active" : ""}>
          <Link prefetch href="/admin/vendors">
.  
jaymehta committed
37 38 39 40
            <div>
              <Image alt="" width={22} height={15} src="/images/admin/icon-user.svg" />
              <span>Vendor</span>
            </div>
.  
jaymehta committed
41 42 43 44
          </Link>
        </li>
        <li className={router.pathname === "/admin/giftcards" ? "active" : ""}>
          <Link prefetch href="/admin/giftcards">
.  
jaymehta committed
45 46 47 48
            <div>
              <Image alt="" width={22} height={15} src="/images/admin/icon-gift.svg" />
              <span>Gift Card</span>
            </div>
.  
jaymehta committed
49 50 51 52
          </Link>
        </li>
        <li className={router.pathname === "/admin/reviews" ? "active" : ""}>
          <Link prefetch href="/admin/reviews">
.  
jaymehta committed
53 54 55 56
            <div>
              <Image alt="" width={22} height={15} src="/images/admin/icon-gift.svg" />
              <span>Reviews</span>
            </div>
.  
jaymehta committed
57 58 59 60 61
          </Link>
        </li>
      </ul>
    </div>
  );
Jyotsna committed
62 63
};

.  
jaymehta committed
64
export default Sidebar;