forked from Movalabs-crew/mova-store
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSidebar.jsx
More file actions
171 lines (168 loc) · 5.68 KB
/
Copy pathSidebar.jsx
File metadata and controls
171 lines (168 loc) · 5.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
"use client";
import { useState } from "react";
import Link from "next/link";
import {
FaHome,
FaInfoCircle,
FaPhone,
FaShoppingCart,
FaRunning,
FaList,
FaSearch,
} from "react-icons/fa";
import { FaShoePrints } from "react-icons/fa6";
import { FcSportsMode } from "react-icons/fc";
import { useAuth } from "../lib/AuthContext";
import Modal from "../components/Modal";
export default function Sidebar() {
const { user } = useAuth();
const [showModal, setShowModal] = useState(false);
const openModal = () => setShowModal(true);
const closeModal = () => setShowModal(false);
return (
<>
<aside className="w-64 bg-white text-gray-700 flex-shrink-0 hidden sm:block pt-10">
<nav className="divide-y divide-gray-200">
<ul className="px-5 py-6 space-y-2">
<li onClick={openModal}>
<input
type="text"
className="w-full bg-gray-100 rounded-lg border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent placeholder-gray-500"
placeholder="Search Shoes"
/>
</li>
<li>
<Link
href="/"
className="flex items-center p-4 hover:bg-gray-100 hover:text-purple-500 transition-colors duration-200"
>
<FaHome className="mr-3" />
Men
</Link>
</li>
<li>
<Link
href="/about"
className="flex items-center p-4 hover:bg-gray-100 hover:text-purple-500 transition-colors duration-200"
>
<FaInfoCircle className="mr-3" />
Women
</Link>
</li>
<li>
<Link
href="/contact"
className="flex items-center p-4 hover:bg-gray-100 hover:text-purple-500 transition-colors duration-200"
>
<FaPhone className="mr-3" />
Kids
</Link>
</li>
<li>
<Link
href="/shop"
className="flex items-center p-4 hover:bg-gray-100 hover:text-purple-500 transition-colors duration-200"
>
<FaShoppingCart className="mr-3" />
Casual
</Link>
</li>
<li>
<Link
href="/collections"
className="flex items-center p-4 hover:bg-gray-100 hover:text-purple-500 transition-colors duration-200"
>
<FcSportsMode className="mr-3" />
Sport
</Link>
</li>
<li>
{user?.uid === "SvGyqjTVt4XgGLsGSzC0amUzC0M2" ? (
<Link
href="/admin"
className="flex items-center p-4 hover:bg-gray-100 hover:text-purple-500 transition-colors duration-200"
>
<FaInfoCircle className="mr-3" />
Admin
</Link>
) : (
""
)}
</li>
<li>
<Link
href="/categories"
className="flex items-center p-4 hover:bg-gray-100 hover:text-purple-500 transition-colors duration-200"
>
<FaList className="mr-3" />
Categories
</Link>
</li>
</ul>
</nav>
</aside>
{/* small screen mobile sidevar */}
<aside className="flex flex-col justify-center w-10 bg-purple-600 text-gray-700 flex-shrink-0 sm:hidden pt-10">
<nav className="divide-y divide-gray-200">
<ul className="py-6 space-y-14 px-2">
<li className=" hover:text-white transition-colors duration-200">
<FaSearch size={20} className="mr-3" />
</li>
<li>
<Link
href="/categories"
className=" hover:text-white transition-colors duration-200"
>
<FaList className="mr-3" size={20} />
</Link>
</li>
<li>
<Link
href="/shop"
className=" hover:text-white transition-colors duration-200"
>
<FaShoppingCart className="mr-3" size={20} />
</Link>
</li>
<li>
<Link
href="/"
className=" hover:text-white transition-colors duration-200"
>
<FaHome className="mr-3" size={20} />
</Link>
</li>
<li>
{user?.uid === "SvGyqjTVt4XgGLsGSzC0amUzC0M2" ? (
<Link
href="/admin"
className=" hover:text-white transition-colors duration-200"
>
<FaInfoCircle className="mr-3" size={20} />
Admin
</Link>
) : (
""
)}
</li>
<li>
<Link
href="/collections"
className="hover:text-purple-500 transition-colors duration-200"
>
<FcSportsMode className="mr-3" size={20} />
</Link>
</li>
</ul>
</nav>
</aside>
<Modal show={showModal} onClose={closeModal}>
<input
type="text"
className="w-full bg-gray-100 rounded-lg border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent placeholder-gray-500"
placeholder="Search Shoes"
/>
</Modal>
</>
);
}