eleven-solutions-common-website-unique-web 1.0.29 → 1.0.30

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.
@@ -1,2 +1,5 @@
1
- declare function Users(): import("react/jsx-runtime").JSX.Element;
1
+ interface UserProps {
2
+ handleNav: () => void;
3
+ }
4
+ declare function Users({ handleNav }: UserProps): import("react/jsx-runtime").JSX.Element;
2
5
  export default Users;
@@ -11,7 +11,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  import { useState, useEffect } from "react";
12
12
  import { FaPlus } from "react-icons/fa";
13
13
  import { fetchUsersApi, deleteUserApi } from "../api/user";
14
- function Users() {
14
+ function Users({ handleNav }) {
15
15
  const [users, setUsers] = useState([]);
16
16
  const fetchUsersData = () => __awaiter(this, void 0, void 0, function* () {
17
17
  const data = yield fetchUsersApi();
@@ -25,13 +25,13 @@ function Users() {
25
25
  useEffect(() => {
26
26
  fetchUsersData();
27
27
  }, []);
28
- const handleNav = (e) => {
29
- e.preventDefault();
30
- window.history.pushState({}, "", "/admin/users/userform");
31
- // Trigger React's routing logic manually if required
32
- const navEvent = new PopStateEvent("popstate");
33
- window.dispatchEvent(navEvent);
34
- };
28
+ // const handleNav = (e: React.FormEvent) => {
29
+ // e.preventDefault();
30
+ // window.history.pushState({}, "", "/admin/users/userform");
31
+ // // Trigger React's routing logic manually if required
32
+ // const navEvent = new PopStateEvent("popstate");
33
+ // window.dispatchEvent(navEvent);
34
+ // };
35
35
  const [currentPage, setCurrentPage] = useState(1);
36
36
  const itemsPerPage = 10;
37
37
  const totalPages = Math.ceil(users.length / itemsPerPage);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleven-solutions-common-website-unique-web",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
4
4
  "main": "./dist/index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -4,7 +4,10 @@ import { useState, useEffect } from "react";
4
4
  import { FaPlus } from "react-icons/fa";
5
5
 
6
6
  import { fetchUsersApi, deleteUserApi } from "../api/user";
7
- function Users() {
7
+ interface UserProps {
8
+ handleNav: () => void;
9
+ }
10
+ function Users({ handleNav }: UserProps) {
8
11
  const [users, setUsers] = useState<any[]>([]);
9
12
 
10
13
  const fetchUsersData = async () => {
@@ -19,14 +22,14 @@ function Users() {
19
22
  useEffect(() => {
20
23
  fetchUsersData();
21
24
  }, []);
22
- const handleNav = (e: React.FormEvent) => {
23
- e.preventDefault();
24
- window.history.pushState({}, "", "/admin/users/userform");
25
+ // const handleNav = (e: React.FormEvent) => {
26
+ // e.preventDefault();
27
+ // window.history.pushState({}, "", "/admin/users/userform");
25
28
 
26
- // Trigger React's routing logic manually if required
27
- const navEvent = new PopStateEvent("popstate");
28
- window.dispatchEvent(navEvent);
29
- };
29
+ // // Trigger React's routing logic manually if required
30
+ // const navEvent = new PopStateEvent("popstate");
31
+ // window.dispatchEvent(navEvent);
32
+ // };
30
33
 
31
34
  const [currentPage, setCurrentPage] = useState(1);
32
35
  const itemsPerPage = 10;