eleven-solutions-common-website-unique-web 20.0.1 → 20.0.3

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.
@@ -14,3 +14,4 @@ export { default as Editor } from "./admin/Editor";
14
14
  export { default as AdminSideBar } from "./admin/Sidebar";
15
15
  export { default as Dashboard } from "./admin/Dashboard";
16
16
  export { registerApi, loginApi } from "./api/api";
17
+ export { default as UpdateUserDetails } from "./useraccount/UpdateUserDetails";
@@ -15,3 +15,4 @@ export { default as Editor } from "./admin/Editor";
15
15
  export { default as AdminSideBar } from "./admin/Sidebar";
16
16
  export { default as Dashboard } from "./admin/Dashboard";
17
17
  export { registerApi, loginApi } from "./api/api";
18
+ export { default as UpdateUserDetails } from "./useraccount/UpdateUserDetails";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleven-solutions-common-website-unique-web",
3
- "version": "20.0.1",
3
+ "version": "20.0.3",
4
4
  "main": "./dist/index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -15,3 +15,5 @@ export { default as Editor } from "./admin/Editor";
15
15
  export { default as AdminSideBar } from "./admin/Sidebar";
16
16
  export { default as Dashboard } from "./admin/Dashboard";
17
17
  export { registerApi, loginApi } from "./api/api";
18
+
19
+ export { default as UpdateUserDetails } from "./useraccount/UpdateUserDetails";
@@ -1,153 +0,0 @@
1
- import React from "react";
2
- import { useState, useEffect } from "react";
3
- import { getProfileApi } from "../api/updateuser";
4
- import Cookies from "universal-cookie";
5
-
6
- interface AddMissingDetailsProps {
7
- usermodalopen: boolean;
8
- closeusermodal: () => void;
9
- url: string;
10
- isDarkMode: boolean;
11
- }
12
- interface UserProfile {
13
- name: string;
14
- mobile: string;
15
- address: string;
16
- }
17
-
18
- const AddMissingDetails: React.FC<AddMissingDetailsProps> = ({
19
- usermodalopen,
20
- closeusermodal,
21
- url,
22
- isDarkMode,
23
- }) => {
24
- const [name, setName] = useState<string>("");
25
- const [mobile, setMobile] = useState<string>("");
26
- const [address, setAddress] = useState<string>("");
27
- const [user, setUser] = useState<UserProfile | undefined>(undefined);
28
-
29
- const cookies = new Cookies();
30
- const token = cookies.get("authToken");
31
-
32
- const userToken = token?.data?.token || token;
33
-
34
- useEffect(() => {
35
- const fetchUserProfile = async () => {
36
- if (usermodalopen && userToken && !user) {
37
- try {
38
- const userProfile = await getProfileApi(userToken, url);
39
- if (userProfile) {
40
- setUser(userProfile);
41
- setName(userProfile.name);
42
- setMobile(userProfile.mobile);
43
- setAddress(userProfile.address);
44
- }
45
- } catch (error) {
46
- console.error("Error fetching user profile:", error);
47
- }
48
- }
49
- };
50
-
51
- fetchUserProfile();
52
- }, [usermodalopen, userToken, user]);
53
-
54
- return (
55
- <div
56
- className={`fixed inset-0 flex items-center justify-center ${
57
- isDarkMode ? "bg-gray-800 bg-opacity-90" : "bg-gray-500 bg-opacity-75"
58
- }`}
59
- >
60
- <div
61
- className={`rounded-lg p-6 w-full max-w-md relative ${
62
- isDarkMode
63
- ? "border border-gray-300 bg-[#242424] text-white"
64
- : "bg-white text-black"
65
- }`}
66
- >
67
- <button
68
- onClick={closeusermodal}
69
- className={`absolute top-3 right-3 ${
70
- isDarkMode
71
- ? "text-gray-300 hover:text-gray-500"
72
- : "text-gray-400 hover:text-gray-600"
73
- } text-2xl`}
74
- >
75
- &times;
76
- </button>
77
-
78
- <h3 className="text-center text-xl font-bold mb-4">Add User Details</h3>
79
-
80
- <div className="mb-4">
81
- <label
82
- className={`block text-sm font-medium mb-1 ${
83
- isDarkMode ? "text-gray-300" : "text-gray-700"
84
- }`}
85
- >
86
- Name
87
- </label>
88
- <input
89
- type="text"
90
- placeholder="Name"
91
- className={`w-full p-2 border rounded focus:outline-none focus:ring ${
92
- isDarkMode
93
- ? "bg-gray-800 border-gray-700 text-white "
94
- : "border-gray-300 "
95
- }`}
96
- />
97
- </div>
98
-
99
- <div className="mb-4">
100
- <label
101
- className={`block text-sm font-medium mb-1 ${
102
- isDarkMode ? "text-gray-300" : "text-gray-700"
103
- }`}
104
- >
105
- Mobile
106
- </label>
107
- <input
108
- type="tel"
109
- placeholder="Mobile"
110
- className={`w-full p-2 border rounded focus:outline-none focus:ring ${
111
- isDarkMode
112
- ? "bg-gray-800 border-gray-700 text-white "
113
- : "border-gray-300 "
114
- }`}
115
- />
116
- </div>
117
-
118
- <div className="mb-4">
119
- <label
120
- className={`block text-sm font-medium mb-1 ${
121
- isDarkMode ? "text-gray-300" : "text-gray-700"
122
- }`}
123
- >
124
- Address
125
- </label>
126
- <input
127
- type="text"
128
- placeholder="Address"
129
- className={`w-full p-2 border rounded focus:outline-none focus:ring ${
130
- isDarkMode
131
- ? "bg-gray-800 border-gray-700 text-white "
132
- : "border-gray-300 "
133
- }`}
134
- />
135
- </div>
136
-
137
- <div className="flex justify-end">
138
- <button
139
- className={`px-4 py-2 rounded ${
140
- isDarkMode
141
- ? "bg-blue-500 hover:bg-blue-400 text-white"
142
- : "bg-blue-500 hover:bg-blue-400 text-white"
143
- }`}
144
- >
145
- Add Details
146
- </button>
147
- </div>
148
- </div>
149
- </div>
150
- );
151
- };
152
-
153
- export default AddMissingDetails;