la-flowerita 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +70 -0
- package/package.json +78 -0
- package/public/favicon.ico +0 -0
- package/public/images/1.jpg +0 -0
- package/public/images/2.jpg +0 -0
- package/public/images/3.jpg +0 -0
- package/public/images/Logo.png +0 -0
- package/public/images/add-user.png +0 -0
- package/public/images/contact-us.png +0 -0
- package/public/images/flower.png +0 -0
- package/public/images/flower_shop.png +0 -0
- package/public/images/flower_shop1.png +0 -0
- package/public/images/flowers/buttercup.png +0 -0
- package/public/images/flowers/daffodil.png +0 -0
- package/public/images/flowers/daisy.png +0 -0
- package/public/images/flowers/jasmine.png +0 -0
- package/public/images/flowers/lily.png +0 -0
- package/public/images/flowers/marigold.png +0 -0
- package/public/images/flowers/orchid.png +0 -0
- package/public/images/flowers/rose.png +0 -0
- package/public/images/flowers/sunflower.png +0 -0
- package/public/images/flowers/tulip.png +0 -0
- package/public/images/garbage.png +0 -0
- package/public/images/icon1.jpg +0 -0
- package/public/images/login.png +0 -0
- package/public/images/refresh.png +0 -0
- package/public/images/transaction.png +0 -0
- package/public/index.html +41 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +26 -0
- package/public/offline.html +44 -0
- package/public/robots.txt +3 -0
- package/public/serviceworker.js +44 -0
- package/server.js +97 -0
- package/src/App.css +38 -0
- package/src/App.js +25 -0
- package/src/App.test.js +8 -0
- package/src/Config/db.js +5 -0
- package/src/Config/mail.js +7 -0
- package/src/Config/passport.js +34 -0
- package/src/Controllers/catalog.controller.js +78 -0
- package/src/Controllers/shoppinglist.controller.js +186 -0
- package/src/Controllers/user.controller.js +214 -0
- package/src/Controllers/wishlist.controller.js +150 -0
- package/src/Middleware/sendMail.js +29 -0
- package/src/Middleware/uploadImage.js +26 -0
- package/src/Models/orderProducts.js +10 -0
- package/src/Models/products.js +17 -0
- package/src/Models/shoppinglists.js +12 -0
- package/src/Models/userShoppinglists.js +9 -0
- package/src/Models/users.js +57 -0
- package/src/Models/wishlists.js +9 -0
- package/src/Routes/auth.js +21 -0
- package/src/Routes/indexRouter.js +40 -0
- package/src/Services/ProductService.js +76 -0
- package/src/Services/ShoppinglistService.js +135 -0
- package/src/Services/UserService.js +63 -0
- package/src/Services/WishlistService.js +105 -0
- package/src/components/About.js +45 -0
- package/src/components/Auth.js +15 -0
- package/src/components/Catalog.js +118 -0
- package/src/components/Chat.js +77 -0
- package/src/components/Contact.js +48 -0
- package/src/components/Dashboard.js +13 -0
- package/src/components/DetailsProductModal.js +362 -0
- package/src/components/LoginModal.js +173 -0
- package/src/components/NewProductModal.js +271 -0
- package/src/components/NoPermission.js +10 -0
- package/src/components/OrderedProduct.js +104 -0
- package/src/components/PreChat.js +51 -0
- package/src/components/Product.js +158 -0
- package/src/components/ResetPassword.js +211 -0
- package/src/components/ShoppingCart.js +198 -0
- package/src/components/SideNav.js +76 -0
- package/src/components/SignupModal.js +306 -0
- package/src/components/Spinner.js +22 -0
- package/src/components/Wishlist.js +195 -0
- package/src/components/social-config.js +17 -0
- package/src/css/about.css +12 -0
- package/src/css/catalog.css +218 -0
- package/src/css/chat.css +191 -0
- package/src/css/contact.css +404 -0
- package/src/css/index.css +129 -0
- package/src/css/newProductModal.css +69 -0
- package/src/css/noPermission.css +89 -0
- package/src/css/orderedProduct.css +0 -0
- package/src/css/resetPassword.css +44 -0
- package/src/css/shoppingCart.css +10 -0
- package/src/css/sideNav.css +68 -0
- package/src/css/spinner.css +23 -0
- package/src/images/1.jpg +0 -0
- package/src/images/2.jpg +0 -0
- package/src/images/3.jpg +0 -0
- package/src/images/Logo.png +0 -0
- package/src/images/add-user.png +0 -0
- package/src/images/buttercup.png +0 -0
- package/src/images/contact-us.png +0 -0
- package/src/images/daffodil.png +0 -0
- package/src/images/daisy.png +0 -0
- package/src/images/flower.png +0 -0
- package/src/images/flower_shop.png +0 -0
- package/src/images/flower_shop1.png +0 -0
- package/src/images/flowers/buttercup.png +0 -0
- package/src/images/flowers/daffodil.png +0 -0
- package/src/images/flowers/daisy.png +0 -0
- package/src/images/flowers/jasmine.png +0 -0
- package/src/images/flowers/lily.png +0 -0
- package/src/images/flowers/marigold.png +0 -0
- package/src/images/flowers/orchid.png +0 -0
- package/src/images/flowers/rose.png +0 -0
- package/src/images/flowers/sunflower.png +0 -0
- package/src/images/flowers/tulip.png +0 -0
- package/src/images/garbage.png +0 -0
- package/src/images/icon1.jpg +0 -0
- package/src/images/jasmine.png +0 -0
- package/src/images/lily.png +0 -0
- package/src/images/login.png +0 -0
- package/src/images/marigold.png +0 -0
- package/src/images/orchid.png +0 -0
- package/src/images/refresh.png +0 -0
- package/src/images/rose.png +0 -0
- package/src/images/sunflower.png +0 -0
- package/src/images/transaction.png +0 -0
- package/src/images/tulip.png +0 -0
- package/src/index.js +371 -0
- package/src/logo.svg +1 -0
- package/src/reportWebVitals.js +13 -0
- package/src/setupTests.js +5 -0
@@ -0,0 +1,68 @@
|
|
1
|
+
#header {
|
2
|
+
position: absolute;
|
3
|
+
width: 220px;
|
4
|
+
}
|
5
|
+
#header .pro-sidebar {
|
6
|
+
height: 100vh;
|
7
|
+
}
|
8
|
+
#header .closemenu {
|
9
|
+
color: #000;
|
10
|
+
position: absolute;
|
11
|
+
right: 0;
|
12
|
+
z-index: 9999;
|
13
|
+
line-height: 20px;
|
14
|
+
border-radius: 50%;
|
15
|
+
font-weight: bold;
|
16
|
+
font-size: 22px;
|
17
|
+
top: 55px;
|
18
|
+
cursor: pointer;
|
19
|
+
}
|
20
|
+
#header .pro-sidebar {
|
21
|
+
width: 100%;
|
22
|
+
min-width: 100%;
|
23
|
+
}
|
24
|
+
#header .pro-sidebar.collapsed {
|
25
|
+
width: 80px;
|
26
|
+
min-width: 80px;
|
27
|
+
}
|
28
|
+
#header .pro-sidebar-inner {
|
29
|
+
background-color: white;
|
30
|
+
box-shadow: 0.5px 0.866px 2px 0px rgba(0, 0, 0, 0.15);
|
31
|
+
}
|
32
|
+
#header .pro-sidebar-inner .pro-sidebar-layout {
|
33
|
+
overflow-y: hidden;
|
34
|
+
}
|
35
|
+
#header .pro-sidebar-inner .pro-sidebar-layout .logotext p {
|
36
|
+
font-size: 20px;
|
37
|
+
padding: 0 20px;
|
38
|
+
color: #000;
|
39
|
+
font-weight: bold;
|
40
|
+
}
|
41
|
+
#header .pro-sidebar-inner .pro-sidebar-layout ul {
|
42
|
+
padding: 0 5px;
|
43
|
+
}
|
44
|
+
#header .pro-sidebar-inner .pro-sidebar-layout ul .pro-inner-item {
|
45
|
+
color: #000;
|
46
|
+
margin: 10px 0px;
|
47
|
+
font-weight: bold;
|
48
|
+
}
|
49
|
+
#header .pro-sidebar-inner .pro-sidebar-layout ul .pro-inner-item .pro-icon-wrapper {
|
50
|
+
background-color: #c2e6ef;
|
51
|
+
color: #000;
|
52
|
+
border-radius: 3px;
|
53
|
+
}
|
54
|
+
#header .pro-sidebar-inner .pro-sidebar-layout ul .pro-inner-item .pro-icon-wrapper .pro-item-content {
|
55
|
+
color: #000;
|
56
|
+
}
|
57
|
+
#header .pro-sidebar-inner .pro-sidebar-layout .active {
|
58
|
+
background-image: linear-gradient(0deg, #44c5d9 0%, #c2e6ef 100%);
|
59
|
+
}
|
60
|
+
#header .logo {
|
61
|
+
padding: 20px;
|
62
|
+
}
|
63
|
+
|
64
|
+
@media only screen and (max-width: 720px) {
|
65
|
+
html {
|
66
|
+
overflow: hidden;
|
67
|
+
}
|
68
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
@keyframes spinner {
|
2
|
+
0% {
|
3
|
+
transform: rotate(0deg);
|
4
|
+
}
|
5
|
+
100% {
|
6
|
+
transform: rotate(360deg);
|
7
|
+
}
|
8
|
+
}
|
9
|
+
.loading-spinner {
|
10
|
+
width: 50px;
|
11
|
+
height: 50px;
|
12
|
+
border: 10px solid #f3f3f3; /* Light grey */
|
13
|
+
border-top: 10px solid #383636; /* Blue */
|
14
|
+
border-radius: 50%;
|
15
|
+
animation: spinner 1.5s linear infinite;
|
16
|
+
}
|
17
|
+
|
18
|
+
.spinner-container {
|
19
|
+
display: grid;
|
20
|
+
justify-content: center;
|
21
|
+
align-items: center;
|
22
|
+
height: 350px;
|
23
|
+
}
|
package/src/images/1.jpg
ADDED
Binary file
|
package/src/images/2.jpg
ADDED
Binary file
|
package/src/images/3.jpg
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
package/src/index.js
ADDED
@@ -0,0 +1,371 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
import React, {Component} from 'react';
|
4
|
+
import {
|
5
|
+
Route,
|
6
|
+
NavLink,
|
7
|
+
HashRouter,
|
8
|
+
Routes
|
9
|
+
} from "react-router-dom";
|
10
|
+
import {render} from 'react-dom';
|
11
|
+
import { createRoot } from 'react-dom/client';
|
12
|
+
import $ from 'jquery';
|
13
|
+
import reportWebVitals from './reportWebVitals';
|
14
|
+
import './css/index.css';
|
15
|
+
import 'bootstrap/dist/css/bootstrap.css'
|
16
|
+
import 'bootstrap/dist/js/bootstrap.min.js';
|
17
|
+
import Contact from './components/Contact.js';
|
18
|
+
import Catalog from './components/Catalog.js';
|
19
|
+
import About from './components/About.js';
|
20
|
+
import LoginModal from './components/LoginModal.js';
|
21
|
+
import SignupModal from './components/SignupModal.js';
|
22
|
+
import ResetPassword from './components/ResetPassword.js';
|
23
|
+
import ProductList from './components/Catalog.js';
|
24
|
+
import ShoppingCart from './components/ShoppingCart.js';
|
25
|
+
import Wishlist from './components/Wishlist.js';
|
26
|
+
import NoPermission from './components/NoPermission.js';
|
27
|
+
import PreChat from './components/PreChat.js';
|
28
|
+
//import react pro sidebar components
|
29
|
+
import {
|
30
|
+
ProSidebar,
|
31
|
+
Menu,
|
32
|
+
MenuItem,
|
33
|
+
SidebarHeader,
|
34
|
+
SidebarFooter,
|
35
|
+
SidebarContent
|
36
|
+
} from "react-pro-sidebar";
|
37
|
+
|
38
|
+
//import icons from react icons
|
39
|
+
import { FaList, FaMailBulk, FaHeart, FaQuestion, FaUsers } from "react-icons/fa";
|
40
|
+
// import {BiLogOut} from "react-icons/bi";
|
41
|
+
import {
|
42
|
+
FiHome,
|
43
|
+
FiLogOut,
|
44
|
+
FiArrowUpCircle,
|
45
|
+
FiArrowDownCircle
|
46
|
+
} from "react-icons/fi";
|
47
|
+
import { RiPencilLine } from "react-icons/ri";
|
48
|
+
import { BiCog } from "react-icons/bi";
|
49
|
+
|
50
|
+
//import sidebar css from react-pro-sidebar module and our custom css
|
51
|
+
import "react-pro-sidebar/dist/css/styles.css";
|
52
|
+
class App extends Component {
|
53
|
+
constructor() {
|
54
|
+
super();
|
55
|
+
this.state = {
|
56
|
+
loggedIn: false,
|
57
|
+
ERROR: "",
|
58
|
+
profileImage: false,
|
59
|
+
numOfProductsInCart: false,
|
60
|
+
numOfProductsInWishlist: false,
|
61
|
+
menuCollapse: false
|
62
|
+
|
63
|
+
};
|
64
|
+
}
|
65
|
+
|
66
|
+
componentDidMount = async() => {
|
67
|
+
var options = {
|
68
|
+
method: "GET",
|
69
|
+
headers: { "Content-Type": "application/json" },
|
70
|
+
};
|
71
|
+
await fetch("/getSession", options).then( res => res.json()).then(
|
72
|
+
(result) => {
|
73
|
+
console.log(result)
|
74
|
+
this.setState({
|
75
|
+
loggedIn: result.isLogged,
|
76
|
+
profileImage: result.profileImage || "",
|
77
|
+
numOfProductsInCart: result.cart.products.length,
|
78
|
+
numOfProductsInWishlist: result.wishlist.products.length
|
79
|
+
});
|
80
|
+
// localStorage.setItem("user", JSON.stringify(result.user));
|
81
|
+
// const saved = localStorage.getItem("user");
|
82
|
+
// const initialValue = JSON.parse(saved);
|
83
|
+
// console.log(initialValue);
|
84
|
+
|
85
|
+
},
|
86
|
+
// Note: it's important to handle errors here
|
87
|
+
// instead of a catch() block so that we don't swallow
|
88
|
+
// exceptions from actual bugs in components.
|
89
|
+
(error) => {
|
90
|
+
this.setState({
|
91
|
+
ERROR: error
|
92
|
+
});
|
93
|
+
}
|
94
|
+
)
|
95
|
+
|
96
|
+
// let currenturl = window.location.href;
|
97
|
+
}
|
98
|
+
|
99
|
+
async onUpdateCart(num){
|
100
|
+
this.setState({
|
101
|
+
numOfProductsInCart: num
|
102
|
+
});
|
103
|
+
}
|
104
|
+
async onUpdateWishlist(num){
|
105
|
+
this.setState({
|
106
|
+
numOfProductsInWishlist: num
|
107
|
+
});
|
108
|
+
}
|
109
|
+
logout = async () =>{
|
110
|
+
var options = {
|
111
|
+
method: "GET",
|
112
|
+
headers: { "Content-Type": "application/json" },
|
113
|
+
};
|
114
|
+
await fetch("/logout", options).then(
|
115
|
+
(result) => {
|
116
|
+
this.setState({
|
117
|
+
loggedIn: false,
|
118
|
+
user: false}
|
119
|
+
//because setState is async function
|
120
|
+
, () => {
|
121
|
+
this.refresh();
|
122
|
+
})
|
123
|
+
},
|
124
|
+
// Note: it's important to handle errors here
|
125
|
+
// instead of a catch() block so that we don't swallow
|
126
|
+
// exceptions from actual bugs in components.
|
127
|
+
(error) => {
|
128
|
+
this.setState({
|
129
|
+
ERROR: error
|
130
|
+
}, () => {
|
131
|
+
console.log(error);
|
132
|
+
})
|
133
|
+
}
|
134
|
+
)
|
135
|
+
}
|
136
|
+
arrayBufferToBase64(buffer) {
|
137
|
+
var binary = '';
|
138
|
+
var bytes = [].slice.call(new Uint8Array(buffer.data));
|
139
|
+
bytes.forEach((b) => binary += String.fromCharCode(b));
|
140
|
+
return window.btoa(binary);
|
141
|
+
};
|
142
|
+
refresh = () => {
|
143
|
+
window.location.reload(false);
|
144
|
+
}
|
145
|
+
async setMenuCollapse(){
|
146
|
+
this.setState({menuCollapse: !this.state.menuCollapse})
|
147
|
+
}
|
148
|
+
render() {
|
149
|
+
var path = "";
|
150
|
+
console.log(this.state.profileImage)
|
151
|
+
try{
|
152
|
+
path = "data:/" + this.state.profileImage.contentType + ";base64," + this.arrayBufferToBase64(this.state.profileImage.data)
|
153
|
+
}
|
154
|
+
catch(e){
|
155
|
+
console.log("couldn't find path of profile image");
|
156
|
+
}
|
157
|
+
return (
|
158
|
+
<div>
|
159
|
+
<HashRouter>
|
160
|
+
<nav
|
161
|
+
className="navbar navbar-expand-lg"
|
162
|
+
style={{
|
163
|
+
backgroundColor: "#e3f2fd",
|
164
|
+
marginBottom: "auto",
|
165
|
+
marginInline: "auto",
|
166
|
+
marginTop: "auto",
|
167
|
+
}}
|
168
|
+
>
|
169
|
+
{this.state.menuCollapse ? <FiArrowDownCircle style={{cursor:"pointer"}} onClick={() => this.setMenuCollapse()}/> : <FiArrowUpCircle style={{cursor:"pointer"}} onClick={() => this.setMenuCollapse()}/>}
|
170
|
+
<div className="container-fluid">
|
171
|
+
<a className="navbar-brand" exact="true" to="/">
|
172
|
+
<img className="avatar" src="images/flower_shop.png" height="60" />
|
173
|
+
</a>
|
174
|
+
<button
|
175
|
+
className="navbar-toggler"
|
176
|
+
type="button"
|
177
|
+
data-bs-toggle="collapse"
|
178
|
+
data-bs-target="#navbarNav"
|
179
|
+
aria-controls="navbarNav"
|
180
|
+
aria-expanded="false"
|
181
|
+
aria-label="Toggle navigation"
|
182
|
+
>
|
183
|
+
<span className="navbar-toggler-icon"></span>
|
184
|
+
</button>
|
185
|
+
<div
|
186
|
+
className="collapse navbar-collapse"
|
187
|
+
id="navbarSupportedContent"
|
188
|
+
>
|
189
|
+
<ul className="navbar-nav me-auto mb-2 mb-lg-0">
|
190
|
+
<li className="nav-item">
|
191
|
+
<NavLink
|
192
|
+
className="nav-link active"
|
193
|
+
style={{ fontSize: "initial" }}
|
194
|
+
aria-current="page"
|
195
|
+
to="/about"
|
196
|
+
id="about"
|
197
|
+
>
|
198
|
+
{this.state.menuCollapse ? "" :"About "}<FaQuestion />
|
199
|
+
</NavLink>
|
200
|
+
</li>
|
201
|
+
<li className="nav-item">
|
202
|
+
<NavLink
|
203
|
+
className="nav-link active"
|
204
|
+
style={{ fontSize: "initial" }}
|
205
|
+
to="/catalog"
|
206
|
+
id="catalog"
|
207
|
+
title="Catalog"
|
208
|
+
>
|
209
|
+
{this.state.menuCollapse ? "": "Flower Catalog "}<FaList />
|
210
|
+
</NavLink>
|
211
|
+
</li>
|
212
|
+
<li className="nav-item">
|
213
|
+
<NavLink
|
214
|
+
className="nav-link active"
|
215
|
+
style={{ fontSize: "initial" }}
|
216
|
+
to="/contact"
|
217
|
+
id="contact"
|
218
|
+
title="Contact"
|
219
|
+
>
|
220
|
+
{this.state.menuCollapse ? "" :"Contact "}<FaMailBulk />
|
221
|
+
</NavLink>
|
222
|
+
</li>
|
223
|
+
<li className="nav-item">
|
224
|
+
<NavLink
|
225
|
+
className="nav-link active"
|
226
|
+
style={{ fontSize: "initial", display: "none" }}
|
227
|
+
to="/users"
|
228
|
+
id="users"
|
229
|
+
title="Users"
|
230
|
+
>
|
231
|
+
{this.state.menuCollapse ? "" : "Manage Users "}<FaUsers />
|
232
|
+
</NavLink>
|
233
|
+
</li>
|
234
|
+
<li className="nav-item">
|
235
|
+
<NavLink
|
236
|
+
className="nav-link active"
|
237
|
+
style={{ fontSize: "initial" }}
|
238
|
+
to="/cart"
|
239
|
+
id="cart"
|
240
|
+
>
|
241
|
+
{this.state.menuCollapse ? "" : "Cart"}<i class="fa" style={{ "font-size": "24px" }}>
|
242
|
+

|
243
|
+
</i>
|
244
|
+
<span className="badge badge-warning" id="lblCartCount">
|
245
|
+
{""}
|
246
|
+
{this.state.numOfProductsInCart}{" "}
|
247
|
+
</span>
|
248
|
+
</NavLink>
|
249
|
+
</li>
|
250
|
+
<li className="nav-item">
|
251
|
+
<NavLink
|
252
|
+
className="nav-link active"
|
253
|
+
style={{ fontSize: "initial" }}
|
254
|
+
to="/wishlist"
|
255
|
+
id="users"
|
256
|
+
>
|
257
|
+
{this.state.menuCollapse ?""
|
258
|
+
: "Wish List"}<i class="fa" style={{ "font-size": "24px" }}>
|
259
|
+
<FaHeart
|
260
|
+
style={{ cursor: "pointer" }}
|
261
|
+
/></i>
|
262
|
+
<span className="badge badge-warning" id="lblCartCount">
|
263
|
+
{" "}
|
264
|
+
{this.state.numOfProductsInWishlist}{" "}
|
265
|
+
</span>
|
266
|
+
</NavLink>
|
267
|
+
</li>
|
268
|
+
<li className="nav-item">
|
269
|
+
<NavLink
|
270
|
+
className="nav-link"
|
271
|
+
style={{fontSize: "initial"}}
|
272
|
+
to="/Chat"
|
273
|
+
id="users"
|
274
|
+
>
|
275
|
+
{this.state.menuCollapse ? ""
|
276
|
+
: "chat"}
|
277
|
+
<i class="fa fa-comments" style={{"font-size": "24px"}}/>
|
278
|
+
|
279
|
+
</NavLink>
|
280
|
+
</li>
|
281
|
+
</ul>
|
282
|
+
<button
|
283
|
+
type="button"
|
284
|
+
className="button-17"
|
285
|
+
id="logoutbtn"
|
286
|
+
style={{ display: this.state.loggedIn ? "block" : "none" }}
|
287
|
+
onClick={() => this.logout()}
|
288
|
+
title="Log Out"
|
289
|
+
>
|
290
|
+
{this.state.menuCollapse ? "" :"Logout"}<FiLogOut />
|
291
|
+
</button>
|
292
|
+
{this.state.loggedIn ? (
|
293
|
+
<img
|
294
|
+
src={path}
|
295
|
+
className="avatar"
|
296
|
+
onError={(e) => {
|
297
|
+
e.target.src =
|
298
|
+
"https://www.freeiconspng.com/uploads/no-image-icon-11.PNG";
|
299
|
+
e.target.onerror = null; // prevents looping
|
300
|
+
}}
|
301
|
+
alt={this.props.name}
|
302
|
+
height="150"
|
303
|
+
/>
|
304
|
+
) : (
|
305
|
+
""
|
306
|
+
)}
|
307
|
+
<LoginModal
|
308
|
+
reloadNavbar={this.refresh}
|
309
|
+
showButton={this.state.loggedIn ? "none" : "block"}
|
310
|
+
menuCollapse={this.state.menuCollapse}
|
311
|
+
/>
|
312
|
+
<SignupModal
|
313
|
+
showButton={this.state.loggedIn ? "none" : "block"}
|
314
|
+
menuCollapse={this.state.menuCollapse}
|
315
|
+
/>
|
316
|
+
</div>
|
317
|
+
</div>
|
318
|
+
</nav>
|
319
|
+
|
320
|
+
<div id="content">
|
321
|
+
<Routes>
|
322
|
+
<Route exact="true" path="/" element={<About />} />
|
323
|
+
<Route path="/about" element={<About />} />
|
324
|
+
<Route path="/catalog" element={<ProductList onUpdateWishlist={(num) => this.onUpdateWishlist(num)} onUpdateCart={(num) => this.onUpdateCart(num)}/>} />
|
325
|
+
<Route path="/cart" element={<ShoppingCart onUpdateCart={(num) => this.onUpdateCart(num)}/>} />
|
326
|
+
<Route path="/wishlist" element={<Wishlist onUpdateCart={(num) => this.onUpdateCart(num)} onUpdateWishlist={(num) => this.onUpdateWishlist(num)}/>} />
|
327
|
+
<Route path="/contact" element={<Contact />} />
|
328
|
+
<Route path="/resetPassword" element={<ResetPassword />} />
|
329
|
+
<Route path="/NoPermission" element={<NoPermission />} />
|
330
|
+
<Route path="/Chat" element={<PreChat />} />
|
331
|
+
</Routes>
|
332
|
+
</div>
|
333
|
+
|
334
|
+
<footer
|
335
|
+
className="container-fluid text-center"
|
336
|
+
style={{ backgroundColor: "#e3f2fd", float: "bottom" }}
|
337
|
+
>
|
338
|
+
<p>© Simha Franko & Adi Malachi Yosef 2022</p>
|
339
|
+
</footer>
|
340
|
+
</HashRouter>
|
341
|
+
</div>
|
342
|
+
);
|
343
|
+
}
|
344
|
+
}
|
345
|
+
|
346
|
+
// createRoot(<App/>, document.getElementById('root'));
|
347
|
+
|
348
|
+
const container = document.getElementById('root');
|
349
|
+
const root = createRoot(container); // createRoot(container!) if you use TypeScript
|
350
|
+
root.render(<App/>);
|
351
|
+
// serviceWorkerRegistration.register();
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
// const root = ReactDOM.createRoot(document.getElementById('root'));
|
362
|
+
// root.render(
|
363
|
+
// <React.StrictMode>
|
364
|
+
// <App />
|
365
|
+
// </React.StrictMode>
|
366
|
+
// );
|
367
|
+
|
368
|
+
// // If you want to start measuring performance in your app, pass a function
|
369
|
+
// // to log results (for example: reportWebVitals(console.log))
|
370
|
+
// // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
371
|
+
// reportWebVitals();
|
package/src/logo.svg
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
const reportWebVitals = onPerfEntry => {
|
2
|
+
if (onPerfEntry && onPerfEntry instanceof Function) {
|
3
|
+
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
4
|
+
getCLS(onPerfEntry);
|
5
|
+
getFID(onPerfEntry);
|
6
|
+
getFCP(onPerfEntry);
|
7
|
+
getLCP(onPerfEntry);
|
8
|
+
getTTFB(onPerfEntry);
|
9
|
+
});
|
10
|
+
}
|
11
|
+
};
|
12
|
+
|
13
|
+
export default reportWebVitals;
|