eleven-solutions-common-website-unique-web 21.0.56 → 22.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. package/dist/App.d.ts +0 -3
  2. package/dist/App.js +0 -2
  3. package/dist/components/admin/Sidebar.d.ts +0 -1
  4. package/dist/components/admin/Sidebar.js +2 -2
  5. package/dist/components/admin/UserForm.js +6 -5
  6. package/dist/components/admin/Users.js +4 -3
  7. package/dist/components/footer/Footer.d.ts +3 -2
  8. package/dist/components/footer/Footer.js +2 -3
  9. package/dist/components/index.d.ts +3 -2
  10. package/dist/components/index.js +3 -2
  11. package/dist/components/login/GoogleButton.js +4 -1
  12. package/dist/components/login/Header.d.ts +3 -1
  13. package/dist/components/login/Header.js +135 -31
  14. package/dist/components/login/Login.d.ts +2 -1
  15. package/dist/components/login/Login.js +15 -65
  16. package/dist/components/login/Setcookie.d.ts +2 -0
  17. package/dist/components/login/Setcookie.js +7 -0
  18. package/dist/components/redux/slices/types/types.d.ts +3 -0
  19. package/dist/components/redux/slices/types/types.js +1 -0
  20. package/dist/components/redux/slices/userSlice.d.ts +20 -0
  21. package/dist/components/redux/slices/userSlice.js +90 -0
  22. package/dist/components/useraccount/UpdateUserDetails.d.ts +1 -0
  23. package/dist/components/useraccount/UpdateUserDetails.js +15 -22
  24. package/package.json +9 -4
  25. package/.github/workflows/main.yml +0 -22
  26. package/azure-pipelines.yml +0 -20
  27. package/dist/components/Navbar.d.ts +0 -6
  28. package/dist/components/Navbar.js +0 -5
  29. package/dist/components/login/View.d.ts +0 -2
  30. package/dist/components/login/View.js +0 -10
  31. package/dist/components/useraccount/AddMissingDetails.d.ts +0 -9
  32. package/dist/components/useraccount/AddMissingDetails.js +0 -56
  33. package/dist/components/useraccount/AddUserDetails.d.ts +0 -9
  34. package/dist/components/useraccount/AddUserDetails.js +0 -21
  35. package/src/App.tsx +0 -21
  36. package/src/components/Navbar.tsx +0 -21
  37. package/src/components/admin/Dashboard.tsx +0 -7
  38. package/src/components/admin/Editor.tsx +0 -25
  39. package/src/components/admin/Sidebar.tsx +0 -102
  40. package/src/components/admin/Taxionomies.tsx +0 -314
  41. package/src/components/admin/TaxonomyForm.tsx +0 -744
  42. package/src/components/admin/Template.tsx +0 -304
  43. package/src/components/admin/TemplateForm.tsx +0 -141
  44. package/src/components/admin/UserForm.tsx +0 -231
  45. package/src/components/admin/Users.tsx +0 -479
  46. package/src/components/api/api.ts +0 -59
  47. package/src/components/api/taxonomy.ts +0 -201
  48. package/src/components/api/template.ts +0 -114
  49. package/src/components/api/updateuser.ts +0 -53
  50. package/src/components/api/user.ts +0 -133
  51. package/src/components/footer/Footer.tsx +0 -128
  52. package/src/components/footer/Privacy.tsx +0 -82
  53. package/src/components/footer/Terms.tsx +0 -156
  54. package/src/components/index.ts +0 -19
  55. package/src/components/login/GoogleButton.tsx +0 -85
  56. package/src/components/login/Header.tsx +0 -340
  57. package/src/components/login/Login.tsx +0 -277
  58. package/src/components/useraccount/AddUserDetails.tsx +0 -136
  59. package/src/components/useraccount/UpdateUserDetails.tsx +0 -214
  60. package/src/index.ts +0 -1
  61. package/tsconfig.json +0 -15
@@ -1,102 +0,0 @@
1
- import React, { useState } from "react";
2
- import { FiMenu } from "react-icons/fi";
3
-
4
- interface Item {
5
- icon: React.ReactNode;
6
- label: string;
7
- onClick: () => void;
8
- }
9
-
10
- interface Group {
11
- heading: string;
12
- items: Item[];
13
- }
14
-
15
- interface DashboardProps {
16
- menuGroups: Group[];
17
- logo: any;
18
- iconName: string;
19
- }
20
-
21
- const Dashboard: React.FC<DashboardProps> = ({
22
- menuGroups,
23
- logo,
24
- iconName,
25
- }) => {
26
- const [isSidebarOpen, setIsSidebarOpen] = useState(false);
27
- const [activeItem, setActiveItem] = useState<string | null>(null);
28
-
29
- const toggleSidebar = () => {
30
- setIsSidebarOpen((prev) => !prev);
31
- };
32
-
33
- const closeSidebar = () => {
34
- setIsSidebarOpen(false);
35
- };
36
-
37
- const handleItemClick = (label: string, onClick: () => void) => {
38
- setActiveItem(label);
39
- onClick();
40
- closeSidebar();
41
- };
42
-
43
- return (
44
- <div className="relative h-full md:pr-6 md:py-4">
45
- <button
46
- className="block md:hidden p-2 text-gray-600 focus:outline-none"
47
- onClick={toggleSidebar}
48
- >
49
- <FiMenu size={24} />
50
- </button>
51
-
52
- {isSidebarOpen && (
53
- <div
54
- className="fixed inset-0 bg-black opacity-50 md:hidden"
55
- onClick={closeSidebar}
56
- ></div>
57
- )}
58
-
59
- <div
60
- className={`absolute md:relative top-0 left-0 z-20 h-full bg-white border-r pr-8 pl-5 overflow-y-auto overflow-x-hidden transform ${
61
- isSidebarOpen ? "translate-x-0" : "-translate-x-full"
62
- } md:translate-x-0 transition-transform duration-300 ease-in-out`}
63
- >
64
- <div
65
- className="w-16 h-16 flex cursor-pointer"
66
- onClick={() => (window.location.href = "/home")}
67
- >
68
- <img className="h-full w-full mx-auto" src={logo} alt="" />
69
- <h2 className="text-2xl ml-1 my-auto font-semibold bg-gradient-to-r from-red-500 to-yellow-400 bg-clip-text text-transparent">
70
- {iconName}
71
- </h2>
72
- </div>
73
-
74
- {menuGroups.map((group, index) => (
75
- <div key={index} className="my-10 space-y-2">
76
- <span className="pl-3 text-sm text-gray-400 uppercase tracking-wider my-3">
77
- {group.heading}
78
- </span>
79
- <ul className="space-y-2">
80
- {group.items.map((item, idx) => (
81
- <li
82
- key={idx}
83
- className={`pl-3 flex items-center space-x-3 cursor-pointer py-2 pr-2 rounded-lg transition duration-200 ${
84
- activeItem === item.label
85
- ? "bg-gray-300 text-gray-800"
86
- : "hover:bg-gray-100 text-gray-700"
87
- }`}
88
- onClick={() => handleItemClick(item.label, item.onClick)}
89
- >
90
- <span className="text-gray-500 text-lg">{item.icon}</span>
91
- <span className="font-medium">{item.label}</span>
92
- </li>
93
- ))}
94
- </ul>
95
- </div>
96
- ))}
97
- </div>
98
- </div>
99
- );
100
- };
101
-
102
- export default Dashboard;
@@ -1,314 +0,0 @@
1
- import React from "react";
2
- import { useState, useEffect } from "react";
3
-
4
- import { FaPlus } from "react-icons/fa";
5
- import { fetchTaxonomiessApi } from "../api/taxonomy";
6
-
7
- interface TaxionomiesProps {
8
- url: string;
9
- }
10
-
11
- const Taxionomies = ({ url }: TaxionomiesProps) => {
12
- const [taxonomy, setTaxonomy] = useState<any[]>([]);
13
-
14
- const fetchTaxonomiesData = async () => {
15
- const data = await fetchTaxonomiessApi(url);
16
- if (data) {
17
- const uniqueTaxonomies = (data as any[]).reduce(
18
- (acc: any[], item: any) => {
19
- if (
20
- !item.parentId &&
21
- !acc.some((taxonomy) => taxonomy.type === item.type)
22
- ) {
23
- acc.push(item);
24
- }
25
- return acc;
26
- },
27
- []
28
- );
29
-
30
- setTaxonomy(uniqueTaxonomies);
31
- } else {
32
- console.error("Failed to fetch taxonomies");
33
- }
34
- };
35
-
36
- useEffect(() => {
37
- fetchTaxonomiesData();
38
- }, []);
39
-
40
- const [currentPage, setCurrentPage] = useState(1);
41
- const itemsPerPage = 10;
42
-
43
- const totalPages = Math.ceil(taxonomy.length / itemsPerPage);
44
-
45
- const handleNextPage = () => {
46
- if (currentPage < totalPages) {
47
- setCurrentPage(currentPage + 1);
48
- }
49
- };
50
-
51
- const handlePreviousPage = () => {
52
- if (currentPage > 1) {
53
- setCurrentPage(currentPage - 1);
54
- }
55
- };
56
-
57
- const handlePageClick = (pageNumber: number) => {
58
- setCurrentPage(pageNumber);
59
- };
60
-
61
- const paginatedTaxonomies = taxonomy.slice(
62
- (currentPage - 1) * itemsPerPage,
63
- currentPage * itemsPerPage
64
- );
65
-
66
- const handleNavigation = (event: React.MouseEvent, path: string) => {
67
- event.preventDefault();
68
- window.history.pushState({}, "", path);
69
- window.dispatchEvent(new PopStateEvent("popstate"));
70
- };
71
-
72
- const handleViewClick = (
73
- event: React.MouseEvent,
74
- path: string,
75
- id: string,
76
- type: string
77
- ) => {
78
- event.preventDefault();
79
-
80
- const queryParams = new URLSearchParams({ id, type });
81
- const fullPath = `${path}${queryParams.toString()}`;
82
-
83
- window.history.pushState({ id, type }, "", fullPath);
84
-
85
- window.dispatchEvent(new PopStateEvent("popstate"));
86
- };
87
-
88
- return (
89
- <div className="container px-4 mx-auto mt-6 h-full">
90
- <div className="w-3/4">
91
- <h1 className="text-3xl font-bold text-blue-600 mb-5">Taxonomy</h1>
92
- </div>
93
- <div className="flex-grow ml-0 w-full mt-10">
94
- <form className="w-full ">
95
- <label
96
- htmlFor="default-search"
97
- className="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"
98
- >
99
- Search
100
- </label>
101
- <div className="relative w-full">
102
- <div className="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
103
- <svg
104
- className="w-4 h-4 text-gray-500 dark:text-gray-400"
105
- aria-hidden="true"
106
- xmlns="http://www.w3.org/2000/svg"
107
- fill="none"
108
- viewBox="0 0 20 20"
109
- >
110
- <path
111
- stroke="currentColor"
112
- stroke-linecap="round"
113
- stroke-linejoin="round"
114
- stroke-width="2"
115
- d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"
116
- />
117
- </svg>
118
- </div>
119
- <input
120
- type="search"
121
- id="default-search"
122
- className="inline-block min-w-full p-3 ps-10 outline-none text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
123
- placeholder="Search Taxonomies"
124
- required
125
- />
126
- <button
127
- type="submit"
128
- className="text-white absolute end-1.5 bottom-1.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
129
- >
130
- Search
131
- </button>
132
- </div>
133
- </form>
134
- </div>
135
- <div className="flex-grow ml-0 w-3/4">
136
- <form className="w-auto">{/* Search Form */}</form>
137
- </div>
138
- <div className="flex-grow ml-0 mt-4 w-full">
139
- <div className="overflow-hidden border border-gray-200 dark:border-gray-700 md:rounded-lg mt-6">
140
- <table className="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
141
- <thead className="bg-gray-50 dark:bg-gray-800">
142
- <tr>
143
- <th
144
- scope="col"
145
- className="px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400"
146
- style={{ width: "200px" }}
147
- >
148
- Actions
149
- </th>
150
- <th
151
- scope="col"
152
- className="py-3.5 px-4 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400"
153
- >
154
- Type
155
- </th>
156
- </tr>
157
- </thead>
158
- <tbody className="bg-white divide-y divide-gray-200 dark:divide-gray-700 dark:bg-gray-900">
159
- {paginatedTaxonomies
160
- .filter((taxonomy) => taxonomy.isView)
161
- .map((taxonomy, index) => (
162
- <tr key={taxonomy.id || index}>
163
- <td className="px-4 py-4 text-sm whitespace-nowrap">
164
- <div className="flex items-center gap-x-6">
165
- {taxonomy.isEdit ? (
166
- <button
167
- type="button"
168
- onClick={(event) => {
169
- handleViewClick(
170
- event,
171
- "/admin/taxinomies/taxonomyform?",
172
- taxonomy.id,
173
- taxonomy.type
174
- );
175
- }}
176
- className="text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none"
177
- >
178
- {/* Edit icon */}
179
- <svg
180
- xmlns="http://www.w3.org/2000/svg"
181
- fill="none"
182
- viewBox="0 0 24 24"
183
- stroke-width="1.5"
184
- stroke="currentColor"
185
- className="w-5 h-5"
186
- >
187
- <path
188
- stroke-linecap="round"
189
- stroke-linejoin="round"
190
- d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"
191
- />
192
- </svg>
193
- </button>
194
- ) : taxonomy.isView ? (
195
- <button
196
- onClick={(event) => {
197
- handleViewClick(
198
- event,
199
- "/admin/taxinomies/taxonomyform?",
200
- taxonomy.id,
201
- taxonomy.type
202
- );
203
- }}
204
- className="text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-blue-500 focus:outline-none"
205
- >
206
- {/* Eye icon */}
207
- <svg
208
- xmlns="http://www.w3.org/2000/svg"
209
- fill="none"
210
- viewBox="0 0 24 24"
211
- stroke-width="1.5"
212
- stroke="currentColor"
213
- className="w-5 h-5"
214
- >
215
- <path
216
- stroke-linecap="round"
217
- stroke-linejoin="round"
218
- d="M12 4.5c4.142 0 7.788 2.93 9 7.5-1.212 4.57-4.858 7.5-9 7.5s-7.788-2.93-9-7.5c1.212-4.57 4.858-7.5 9-7.5z"
219
- />
220
- <path
221
- stroke-linecap="round"
222
- stroke-linejoin="round"
223
- d="M12 9a3 3 0 100 6 3 3 0 000-6z"
224
- />
225
- </svg>
226
- </button>
227
- ) : null}
228
- </div>
229
- </td>
230
- <td className="px-4 py-4 text-sm font-medium text-gray-700 whitespace-nowrap">
231
- <div className="inline-flex items-center gap-x-3">
232
- <div className="flex items-center gap-x-2">
233
- <div>
234
- <h2 className=" text-sm font-medium text-gray-800 dark:text-white ">
235
- {taxonomy.type}
236
- </h2>
237
- </div>
238
- </div>
239
- </div>
240
- </td>
241
- </tr>
242
- ))}
243
- </tbody>
244
- </table>
245
- </div>
246
-
247
- <div className="flex items-center justify-between mt-6">
248
- <button
249
- onClick={handlePreviousPage}
250
- disabled={currentPage === 1}
251
- className="flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800"
252
- >
253
- <svg
254
- xmlns="http://www.w3.org/2000/svg"
255
- fill="none"
256
- viewBox="0 0 24 24"
257
- stroke-width="1.5"
258
- stroke="currentColor"
259
- className="w-5 h-5 rtl:-scale-x-100"
260
- >
261
- <path
262
- stroke-linecap="round"
263
- stroke-linejoin="round"
264
- d="M6.75 15.75L3 12m0 0l3.75-3.75M3 12h18"
265
- />
266
- </svg>
267
-
268
- <span>previous</span>
269
- </button>
270
-
271
- <div className="items-center hidden lg:flex gap-x-3">
272
- {Array.from({ length: totalPages }, (_, index) => (
273
- <button
274
- key={index + 1}
275
- onClick={() => handlePageClick(index + 1)}
276
- className={`px-2 py-1 text-sm ${
277
- currentPage === index + 1
278
- ? "text-blue-500 bg-blue-100"
279
- : "text-gray-500 hover:bg-gray-100"
280
- } rounded-md`}
281
- >
282
- {index + 1}
283
- </button>
284
- ))}
285
- </div>
286
- <button
287
- onClick={handleNextPage}
288
- disabled={currentPage === totalPages}
289
- className="flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800"
290
- >
291
- <span>Next</span>
292
-
293
- <svg
294
- xmlns="http://www.w3.org/2000/svg"
295
- fill="none"
296
- viewBox="0 0 24 24"
297
- stroke-width="1.5"
298
- stroke="currentColor"
299
- className="w-5 h-5 rtl:-scale-x-100"
300
- >
301
- <path
302
- stroke-linecap="round"
303
- stroke-linejoin="round"
304
- d="M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3"
305
- />
306
- </svg>
307
- </button>
308
- </div>
309
- </div>
310
- </div>
311
- );
312
- };
313
-
314
- export default Taxionomies;