eleven-solutions-common-website-unique-web 21.0.3 → 21.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,7 +53,7 @@ const Users = ({ url }) => {
|
|
53
53
|
});
|
54
54
|
const handleRoleTypeChange = (event) => {
|
55
55
|
setSelectedRoleType(event.target.value);
|
56
|
-
setCurrentPage(1);
|
56
|
+
setCurrentPage(1);
|
57
57
|
};
|
58
58
|
const totalPages = Math.ceil(filteredUsers.length / itemsPerPage);
|
59
59
|
const handleNextPage = () => {
|
@@ -103,6 +103,6 @@ const Users = ({ url }) => {
|
|
103
103
|
: "Not Provided" }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: user.roleType === 1 ? "Guest" : "Admin" })] }, user.id || index))) })] }) }), _jsxs("div", { className: "flex items-center justify-between mt-6", children: [_jsxs("button", { onClick: handlePreviousPage, disabled: currentPage === 1, 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", children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5 rtl:-scale-x-100", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M6.75 15.75L3 12m0 0l3.75-3.75M3 12h18" }) }), _jsx("span", { children: "previous" })] }), _jsx("div", { className: "items-center hidden lg:flex gap-x-3", children: Array.from({ length: totalPages }, (_, index) => (_jsx("button", { onClick: () => handlePageClick(index + 1), className: `px-2 py-1 text-sm ${currentPage === index + 1
|
104
104
|
? "text-blue-500 bg-blue-100"
|
105
105
|
: "text-gray-500 hover:bg-gray-100"} rounded-md`, children: index + 1 }, index + 1))) }), _jsxs("button", { onClick: handleNextPage, disabled: currentPage === totalPages, 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", children: [_jsx("span", { children: "Next" }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5 rtl:-scale-x-100", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3" }) })] })] }), _jsx("div", { className: "flex-grow ml-0 mt-4 w-0", children: _jsxs("button", { type: "button", onClick: (event) => handleNavigation(event, "/admin/users/userform"), className: "flex items-center justify-center px-6 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-blue-600 rounded-lg hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80", children: [_jsx(FaPlus, { className: "mr-2 font-medium" }), "User"] }) })] }), _jsx("div", { className: "inset-0 bg-gray-800 bg-opacity-50 z-50 transition-opacity duration-300", children: _jsxs("div", { className: `fixed top-0 right-0 h-full w-[300px] md:w-[500px] bg-white p-4 rounded-md shadow-lg transform transition-transform duration-500 ease-in-out
|
106
|
-
${filterModal ? "translate-x-0" : "translate-x-full"}`, children: [_jsx("h1", { className: "text-2xl md:text-3xl font-bold text-blue-600 mb-4 md:mb-6", children: "Filter" }), _jsx("button", { onClick: () => setFilterModal(false), className: "absolute top-1 right-3 text-gray-400 hover:text-gray-600 text-2xl", children: "\u00D7" }), _jsx("div", { className: "flex flex-col", children: _jsxs("div", { className: "mb-4 flex flex-col", children: [_jsx("label", { className: "block text-gray-700 mb-2", children: "Role Type" }), _jsx("div", { className: "w-full", children: _jsxs("select", { value: selectedRoleType, onChange: handleRoleTypeChange, required: true, className: "w-full px-4 py-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", children: [_jsx("option", { value: "", children: "Select a Role Type" }), _jsx("option", { value: "
|
106
|
+
${filterModal ? "translate-x-0" : "translate-x-full"}`, children: [_jsx("h1", { className: "text-2xl md:text-3xl font-bold text-blue-600 mb-4 md:mb-6", children: "Filter" }), _jsx("button", { onClick: () => setFilterModal(false), className: "absolute top-1 right-3 text-gray-400 hover:text-gray-600 text-2xl", children: "\u00D7" }), _jsx("div", { className: "flex flex-col", children: _jsxs("div", { className: "mb-4 flex flex-col", children: [_jsx("label", { className: "block text-gray-700 mb-2", children: "Role Type" }), _jsx("div", { className: "w-full", children: _jsxs("select", { value: Number(selectedRoleType), onChange: handleRoleTypeChange, required: true, className: "w-full px-4 py-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", children: [_jsx("option", { value: "", children: "Select a Role Type" }), _jsx("option", { value: "1", children: "Guest" }), _jsx("option", { value: "2", children: "Admin" })] }) })] }) })] }) })] }));
|
107
107
|
};
|
108
108
|
export default Users;
|
package/package.json
CHANGED
@@ -65,7 +65,7 @@ const Users = ({ url }: UsersProps) => {
|
|
65
65
|
event: React.ChangeEvent<HTMLSelectElement>
|
66
66
|
) => {
|
67
67
|
setSelectedRoleType(event.target.value);
|
68
|
-
setCurrentPage(1);
|
68
|
+
setCurrentPage(1);
|
69
69
|
};
|
70
70
|
|
71
71
|
const totalPages = Math.ceil(filteredUsers.length / itemsPerPage);
|
@@ -441,14 +441,14 @@ const Users = ({ url }: UsersProps) => {
|
|
441
441
|
<label className="block text-gray-700 mb-2">Role Type</label>
|
442
442
|
<div className="w-full">
|
443
443
|
<select
|
444
|
-
value={selectedRoleType}
|
444
|
+
value={Number(selectedRoleType)}
|
445
445
|
onChange={handleRoleTypeChange}
|
446
446
|
required
|
447
447
|
className="w-full px-4 py-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring"
|
448
448
|
>
|
449
449
|
<option value="">Select a Role Type</option>
|
450
|
-
<option value="
|
451
|
-
<option value="
|
450
|
+
<option value="1">Guest</option>
|
451
|
+
<option value="2">Admin</option>
|
452
452
|
</select>
|
453
453
|
</div>
|
454
454
|
</div>
|