la-flowerita 0.1.0 → 0.2.0
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.
- package/package.json +4 -2
- package/server.js +8 -7
- package/src/Controllers/order.controller.js +68 -0
- package/src/Controllers/shoppinglist.controller.js +15 -0
- package/src/Controllers/user.controller.js +79 -22
- package/src/Models/orders.js +12 -0
- package/src/Routes/indexRouter.js +14 -1
- package/src/Services/OrderService.js +46 -0
- package/src/Services/ShoppinglistService.js +2 -2
- package/src/Services/UserService.js +11 -5
- package/src/components/ManageOrders.js +109 -0
- package/src/components/ManageUsers.js +127 -0
- package/src/components/MyOrder.js +62 -0
- package/src/components/MyOrders.js +99 -0
- package/src/components/Order.js +78 -0
- package/src/components/UpdateUserModal.js +304 -0
- package/src/components/User.js +117 -0
- package/src/css/users.css +176 -0
- package/src/index.js +37 -1
@@ -0,0 +1,117 @@
|
|
1
|
+
import { React, Component } from "react";
|
2
|
+
import sampleImage from "../logo.svg";
|
3
|
+
import "../css/users.css";
|
4
|
+
// import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
5
|
+
import { FaEdit,AiFillDelete,FaHeart, FaRegHeart, FaShoppingCart, FaEye } from "react-icons/fa";
|
6
|
+
import UpdateUserModal from "./UpdateUserModal.js";
|
7
|
+
import swal from "sweetalert";
|
8
|
+
class User extends Component {
|
9
|
+
constructor(props) {
|
10
|
+
super(props);
|
11
|
+
this.state = {
|
12
|
+
name: props.name,
|
13
|
+
phone: props.phone,
|
14
|
+
degree: props.degree,
|
15
|
+
address: props.address,
|
16
|
+
email: props.email,
|
17
|
+
profileImage: props.profileImage,
|
18
|
+
};
|
19
|
+
console.log(props);
|
20
|
+
}
|
21
|
+
|
22
|
+
arrayBufferToBase64(buffer) {
|
23
|
+
var binary = "";
|
24
|
+
var bytes = [].slice.call(new Uint8Array(buffer.data));
|
25
|
+
bytes.forEach((b) => (binary += String.fromCharCode(b)));
|
26
|
+
return window.btoa(binary);
|
27
|
+
}
|
28
|
+
render() {
|
29
|
+
var path = "";
|
30
|
+
if(this.props.profileImage)
|
31
|
+
{path = "data:/" +
|
32
|
+
this.props.profileImage.contentType+
|
33
|
+
";base64," + this.arrayBufferToBase64(this.props.profileImage.data);}
|
34
|
+
var currentUser = this.props.user;
|
35
|
+
return (
|
36
|
+
<tr class="candidates-list" key={currentUser._id}>
|
37
|
+
<td class="title">
|
38
|
+
<div class="thumb">
|
39
|
+
<img class="img-fluid" src={path} alt="" onError={(e) => {
|
40
|
+
e.target.src =
|
41
|
+
"https://www.freeiconspng.com/uploads/no-image-icon-11.PNG";
|
42
|
+
e.target.onerror = null; // prevents looping
|
43
|
+
}}/>
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div class="candidate-list-details">
|
47
|
+
<div class="candidate-list-info">
|
48
|
+
<div class="candidate-list-title">
|
49
|
+
<h5 class="mb-0"><a>{this.props.name}</a></h5>
|
50
|
+
</div>
|
51
|
+
<div class="candidate-list-option">
|
52
|
+
|
53
|
+
<ul class="list-unstyled">
|
54
|
+
<li><i class="fas fa-phone pr-1"></i>{this.props.phone}</li>
|
55
|
+
<li><i class="fas fa-map-marker-alt pr-1"></i>{this.props.address}</li>
|
56
|
+
<li><i class="fas fa-envelope pr-1"></i>{this.props.email}</li>
|
57
|
+
</ul>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
</div>
|
62
|
+
</td>
|
63
|
+
<td class="candidate-list-favourite-time text-center">
|
64
|
+
<h5 class="mb-0"><a>{this.props.degree}</a></h5>
|
65
|
+
</td>
|
66
|
+
<td class="candidate-list-favourite-time text-center">
|
67
|
+
<ul class="list-unstyled mb-0 d-flex justify-content-end">
|
68
|
+
<UpdateUserModal
|
69
|
+
_id={currentUser._id}
|
70
|
+
name={this.props.name}
|
71
|
+
phone={this.props.phone}
|
72
|
+
degree={this.props.degree}
|
73
|
+
address={this.props.address}
|
74
|
+
email={this.props.email}
|
75
|
+
// path = {path}
|
76
|
+
/>
|
77
|
+
</ul>
|
78
|
+
</td>
|
79
|
+
</tr>
|
80
|
+
// <div className="row product">
|
81
|
+
// <div className="col-md-2">
|
82
|
+
// <div>
|
83
|
+
// <h5>{this.props.degree}</h5>
|
84
|
+
// </div>
|
85
|
+
// <div>
|
86
|
+
// <h4>{this.props.name}</h4>
|
87
|
+
// <div>
|
88
|
+
// <h5>{this.props.address}</h5>
|
89
|
+
// </div>
|
90
|
+
// <div>
|
91
|
+
// <h5>{this.props.phone}</h5>
|
92
|
+
// </div>
|
93
|
+
// <div>
|
94
|
+
// <h5>{this.props.email}</h5>
|
95
|
+
// </div>
|
96
|
+
// </div>
|
97
|
+
// </div>
|
98
|
+
// <div className="col-md-1 product-price">
|
99
|
+
// <UpdateUserModal
|
100
|
+
// id={this.props.id}
|
101
|
+
// name={this.props.name}
|
102
|
+
// phone={this.props.phone}
|
103
|
+
// degree={this.props.degree}
|
104
|
+
// address={this.props.address}
|
105
|
+
// email={this.props.email}
|
106
|
+
// // path = {path}
|
107
|
+
|
108
|
+
// />
|
109
|
+
// </div>
|
110
|
+
|
111
|
+
// </div>
|
112
|
+
|
113
|
+
);
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
export default User;
|
@@ -0,0 +1,176 @@
|
|
1
|
+
body{
|
2
|
+
background-color: #f8f9fa!important
|
3
|
+
}
|
4
|
+
.p-4 {
|
5
|
+
padding: 1.5rem!important;
|
6
|
+
}
|
7
|
+
.mb-0, .my-0 {
|
8
|
+
margin-bottom: 0!important;
|
9
|
+
}
|
10
|
+
.shadow-sm {
|
11
|
+
box-shadow: 0 .125rem .25rem rgba(0,0,0,.075)!important;
|
12
|
+
}
|
13
|
+
|
14
|
+
/* user-dashboard-info-box */
|
15
|
+
.user-dashboard-info-box .candidates-list .thumb {
|
16
|
+
margin-right: 20px;
|
17
|
+
}
|
18
|
+
.user-dashboard-info-box .candidates-list .thumb img {
|
19
|
+
width: 80px;
|
20
|
+
height: 80px;
|
21
|
+
-o-object-fit: cover;
|
22
|
+
object-fit: cover;
|
23
|
+
overflow: hidden;
|
24
|
+
border-radius: 50%;
|
25
|
+
}
|
26
|
+
|
27
|
+
.user-dashboard-info-box .title {
|
28
|
+
display: -webkit-box;
|
29
|
+
display: -ms-flexbox;
|
30
|
+
display: flex;
|
31
|
+
-webkit-box-align: center;
|
32
|
+
-ms-flex-align: center;
|
33
|
+
align-items: center;
|
34
|
+
padding: 30px 0;
|
35
|
+
}
|
36
|
+
|
37
|
+
.user-dashboard-info-box .candidates-list td {
|
38
|
+
vertical-align: middle;
|
39
|
+
}
|
40
|
+
|
41
|
+
.user-dashboard-info-box td li {
|
42
|
+
margin: 0 4px;
|
43
|
+
}
|
44
|
+
|
45
|
+
.user-dashboard-info-box .table thead th {
|
46
|
+
border-bottom: none;
|
47
|
+
}
|
48
|
+
|
49
|
+
.table.manage-candidates-top th {
|
50
|
+
border: 0;
|
51
|
+
}
|
52
|
+
|
53
|
+
.user-dashboard-info-box .candidate-list-favourite-time .candidate-list-favourite {
|
54
|
+
margin-bottom: 10px;
|
55
|
+
}
|
56
|
+
|
57
|
+
.table.manage-candidates-top {
|
58
|
+
min-width: 650px;
|
59
|
+
}
|
60
|
+
|
61
|
+
.user-dashboard-info-box .candidate-list-details ul {
|
62
|
+
color: #969696;
|
63
|
+
}
|
64
|
+
|
65
|
+
/* Candidate List */
|
66
|
+
.candidate-list {
|
67
|
+
background: #ffffff;
|
68
|
+
display: -webkit-box;
|
69
|
+
display: -ms-flexbox;
|
70
|
+
display: flex;
|
71
|
+
border-bottom: 1px solid #eeeeee;
|
72
|
+
-webkit-box-align: center;
|
73
|
+
-ms-flex-align: center;
|
74
|
+
align-items: center;
|
75
|
+
padding: 20px;
|
76
|
+
-webkit-transition: all 0.3s ease-in-out;
|
77
|
+
transition: all 0.3s ease-in-out;
|
78
|
+
}
|
79
|
+
.candidate-list:hover {
|
80
|
+
-webkit-box-shadow: 0px 0px 34px 4px rgba(33, 37, 41, 0.06);
|
81
|
+
box-shadow: 0px 0px 34px 4px rgba(33, 37, 41, 0.06);
|
82
|
+
position: relative;
|
83
|
+
z-index: 99;
|
84
|
+
}
|
85
|
+
.candidate-list:hover a.candidate-list-favourite {
|
86
|
+
color: #e74c3c;
|
87
|
+
-webkit-box-shadow: -1px 4px 10px 1px rgba(24, 111, 201, 0.1);
|
88
|
+
box-shadow: -1px 4px 10px 1px rgba(24, 111, 201, 0.1);
|
89
|
+
}
|
90
|
+
|
91
|
+
.candidate-list .candidate-list-image {
|
92
|
+
margin-right: 25px;
|
93
|
+
-webkit-box-flex: 0;
|
94
|
+
-ms-flex: 0 0 80px;
|
95
|
+
flex: 0 0 80px;
|
96
|
+
border: none;
|
97
|
+
}
|
98
|
+
.candidate-list .candidate-list-image img {
|
99
|
+
width: 80px;
|
100
|
+
height: 80px;
|
101
|
+
-o-object-fit: cover;
|
102
|
+
object-fit: cover;
|
103
|
+
}
|
104
|
+
|
105
|
+
.candidate-list-title {
|
106
|
+
margin-bottom: 5px;
|
107
|
+
}
|
108
|
+
|
109
|
+
.candidate-list-details ul {
|
110
|
+
display: -webkit-box;
|
111
|
+
display: -ms-flexbox;
|
112
|
+
display: flex;
|
113
|
+
-ms-flex-wrap: wrap;
|
114
|
+
flex-wrap: wrap;
|
115
|
+
margin-bottom: 0px;
|
116
|
+
}
|
117
|
+
.candidate-list-details ul li {
|
118
|
+
margin: 5px 10px 5px 0px;
|
119
|
+
font-size: 13px;
|
120
|
+
}
|
121
|
+
|
122
|
+
.candidate-list .candidate-list-favourite-time {
|
123
|
+
margin-left: auto;
|
124
|
+
text-align: center;
|
125
|
+
font-size: 13px;
|
126
|
+
-webkit-box-flex: 0;
|
127
|
+
-ms-flex: 0 0 90px;
|
128
|
+
flex: 0 0 90px;
|
129
|
+
}
|
130
|
+
.candidate-list .candidate-list-favourite-time span {
|
131
|
+
display: block;
|
132
|
+
margin: 0 auto;
|
133
|
+
}
|
134
|
+
.candidate-list .candidate-list-favourite-time .candidate-list-favourite {
|
135
|
+
display: inline-block;
|
136
|
+
position: relative;
|
137
|
+
height: 40px;
|
138
|
+
width: 40px;
|
139
|
+
line-height: 40px;
|
140
|
+
border: 1px solid #eeeeee;
|
141
|
+
border-radius: 100%;
|
142
|
+
text-align: center;
|
143
|
+
-webkit-transition: all 0.3s ease-in-out;
|
144
|
+
transition: all 0.3s ease-in-out;
|
145
|
+
margin-bottom: 20px;
|
146
|
+
font-size: 16px;
|
147
|
+
color: #646f79;
|
148
|
+
}
|
149
|
+
.candidate-list .candidate-list-favourite-time .candidate-list-favourite:hover {
|
150
|
+
background: #ffffff;
|
151
|
+
color: #e74c3c;
|
152
|
+
}
|
153
|
+
|
154
|
+
.candidate-banner .candidate-list:hover {
|
155
|
+
position: inherit;
|
156
|
+
-webkit-box-shadow: inherit;
|
157
|
+
box-shadow: inherit;
|
158
|
+
z-index: inherit;
|
159
|
+
}
|
160
|
+
|
161
|
+
.bg-white {
|
162
|
+
background-color: #ffffff !important;
|
163
|
+
}
|
164
|
+
.p-4 {
|
165
|
+
padding: 1.5rem!important;
|
166
|
+
}
|
167
|
+
.mb-0, .my-0 {
|
168
|
+
margin-bottom: 0!important;
|
169
|
+
}
|
170
|
+
.shadow-sm {
|
171
|
+
box-shadow: 0 .125rem .25rem rgba(0,0,0,.075)!important;
|
172
|
+
}
|
173
|
+
|
174
|
+
.user-dashboard-info-box .candidates-list .thumb {
|
175
|
+
margin-right: 20px;
|
176
|
+
}
|
package/src/index.js
CHANGED
@@ -24,6 +24,11 @@ import ProductList from './components/Catalog.js';
|
|
24
24
|
import ShoppingCart from './components/ShoppingCart.js';
|
25
25
|
import Wishlist from './components/Wishlist.js';
|
26
26
|
import NoPermission from './components/NoPermission.js';
|
27
|
+
|
28
|
+
import UserList from './components/ManageUsers';
|
29
|
+
import ManageOrders from './components/ManageOrders';
|
30
|
+
import MyOrders from './components/MyOrders';
|
31
|
+
|
27
32
|
import PreChat from './components/PreChat.js';
|
28
33
|
//import react pro sidebar components
|
29
34
|
import {
|
@@ -35,6 +40,7 @@ import {
|
|
35
40
|
SidebarContent
|
36
41
|
} from "react-pro-sidebar";
|
37
42
|
|
43
|
+
|
38
44
|
//import icons from react icons
|
39
45
|
import { FaList, FaMailBulk, FaHeart, FaQuestion, FaUsers } from "react-icons/fa";
|
40
46
|
// import {BiLogOut} from "react-icons/bi";
|
@@ -49,6 +55,7 @@ import { BiCog } from "react-icons/bi";
|
|
49
55
|
|
50
56
|
//import sidebar css from react-pro-sidebar module and our custom css
|
51
57
|
import "react-pro-sidebar/dist/css/styles.css";
|
58
|
+
|
52
59
|
class App extends Component {
|
53
60
|
constructor() {
|
54
61
|
super();
|
@@ -223,7 +230,7 @@ class App extends Component {
|
|
223
230
|
<li className="nav-item">
|
224
231
|
<NavLink
|
225
232
|
className="nav-link active"
|
226
|
-
style={{ fontSize: "initial"
|
233
|
+
style={{ fontSize: "initial" }}//, display: "none"
|
227
234
|
to="/users"
|
228
235
|
id="users"
|
229
236
|
title="Users"
|
@@ -231,6 +238,28 @@ class App extends Component {
|
|
231
238
|
{this.state.menuCollapse ? "" : "Manage Users "}<FaUsers />
|
232
239
|
</NavLink>
|
233
240
|
</li>
|
241
|
+
<li className="nav-item">
|
242
|
+
<NavLink
|
243
|
+
className="nav-link active"
|
244
|
+
style={{ fontSize: "initial" }}//, display: "none"
|
245
|
+
to="/orders"
|
246
|
+
id="orders"
|
247
|
+
title="Orders"
|
248
|
+
>
|
249
|
+
{this.state.menuCollapse ? "" : "Manage Orders "}<FaUsers />
|
250
|
+
</NavLink>
|
251
|
+
</li>
|
252
|
+
<li className="nav-item">
|
253
|
+
<NavLink
|
254
|
+
className="nav-link active"
|
255
|
+
style={{ fontSize: "initial" }}//, display: "none"
|
256
|
+
to="/myOrders"
|
257
|
+
id="myOrders"
|
258
|
+
title="myOrders"
|
259
|
+
>
|
260
|
+
{this.state.menuCollapse ? "" : "My Orders "}<FaUsers />
|
261
|
+
</NavLink>
|
262
|
+
</li>
|
234
263
|
<li className="nav-item">
|
235
264
|
<NavLink
|
236
265
|
className="nav-link active"
|
@@ -327,7 +356,14 @@ class App extends Component {
|
|
327
356
|
<Route path="/contact" element={<Contact />} />
|
328
357
|
<Route path="/resetPassword" element={<ResetPassword />} />
|
329
358
|
<Route path="/NoPermission" element={<NoPermission />} />
|
359
|
+
|
360
|
+
<Route path="/users" element={<UserList />} />
|
361
|
+
|
362
|
+
<Route path="/orders" element={<ManageOrders />} />
|
363
|
+
<Route path="/myOrders" element={<MyOrders />} />
|
364
|
+
|
330
365
|
<Route path="/Chat" element={<PreChat />} />
|
366
|
+
|
331
367
|
</Routes>
|
332
368
|
</div>
|
333
369
|
|