Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cfe1ebd

Browse files
update -g React home.jsx
1 parent b3f49cc commit cfe1ebd

File tree

4 files changed

+41
-18
lines changed

4 files changed

+41
-18
lines changed

‎react-app/src/components/Home/Checkout.jsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export default function Checkout({display,onClose,items,onChangeQuantity,onRemov
5151
<input type="text" placeholder="ex:amrani" id="lastnameinput" /><br/>
5252
<label>Address</label><br/>
5353
<input type="text" placeholder="ex:Rue arrahma casablanca" id="addressinput" /><br/>
54+
<label>City</label><br/>
5455
<select>
5556
<option>Marrakech</option>
5657
<option>Rabat</option>
@@ -60,6 +61,7 @@ export default function Checkout({display,onClose,items,onChangeQuantity,onRemov
6061
</select><br/>
6162
<label>Phone Number</label><br/>
6263
<input type="tel" id="phonenumberinput" placeholder="ex:0611112211" /><br/>
64+
6365
<button className="btn-send-checkout">
6466
<span class="material-icons-sharp" style={{"color":"var(--color-background)"}}>
6567
shopping_cart_checkout

‎react-app/src/components/Home/home.css‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,4 +264,15 @@
264264
font-size: 16px;
265265
background-color: #7380ec;
266266
color: #f6f6f9;
267+
}
268+
.form-checkout label{
269+
padding-top: 10px;
270+
271+
}
272+
.footer-homepage-panel{
273+
padding: 40px;
274+
color: #f6f6f9;
275+
}
276+
.footer-homepage-panel b{
277+
color: #f6f6f9;
267278
}

‎react-app/src/components/Home/home.jsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ export default function HomePage() {
110110
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/39/TT_Electronics_logo.svg/2560px-TT_Electronics_logo.svg.png" alt="logo" width={'400px'} />
111111
</section>
112112
<ProductSection data={Products.slice(0,14)} addToCart={addtoCart}/>
113+
<div className="footer-homepage-panel">
114+
Developed By <b>Yassine Boujrada</b>, <b>Youssef Mahdi</b>, <b>Abdelouahab Bella</b>
115+
</div>
113116
</main>
114117
<Cart display={OpenBasketWindow} items={InCartProducts} onChangeQuantity={ModifyQuantity} onClose={onCloseBasket} onRemove={removeFromCart} openCheckout={OpenCheckout}/>
115118
<Checkout display={OpenCheckoutWindow} items={InCartProducts} onChangeQuantity={ModifyQuantity} onClose={closeCheckoutWindow} onRemove={removeFromCart} />

‎react-app/src/components/Login/LoginBody.jsx‎

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { useNavigate, Link } from "react-router-dom";
22
import React,{useState} from 'react';
33
import { ToastContainer, toast } from "react-toastify";
44
import "react-toastify/dist/ReactToastify.css";
5-
import axios from "axios"
5+
// import axios from "axios";
6+
import AuthApi from "../../Api/AuthApi";
67

78
export default function LoginBody() {
89

@@ -36,27 +37,33 @@ export default function LoginBody() {
3637
const handleSubmit = async (event) => {
3738
event.preventDefault();
3839
if (validateForm()) {
40+
localStorage.setItem(
41+
"Auth",
42+
JSON.stringify(document.cookie)
43+
);
44+
navigate("/a/Dashboard");
3945
try {
4046
const { username, password } = values;
4147
console.log(values);
42-
const data = await axios.post(
43-
"http://localhost:8081/api/v1/auth/authenticate",
44-
{
45-
email: username,
46-
password:password,
47-
}
48-
);
48+
// const data = await axios.post(
49+
// "http://localhost:8081/api/v1/auth/authenticate",
50+
// {
51+
// email: username,
52+
// password:password,
53+
// }
54+
// );
55+
const data=AuthApi.AuthHandler(username,password);
4956

50-
if (data.status === 200) {
51-
localStorage.setItem(
52-
"Auth",
53-
JSON.stringify(document.cookie)
54-
);
55-
navigate("/");
56-
}
57-
else{
58-
toast.error("There is an error plz check you're information", toastOptions);
59-
}
57+
// if (data.status === 200) {
58+
// localStorage.setItem(
59+
// "Auth",
60+
// JSON.stringify(document.cookie)
61+
// );
62+
// navigate("/");
63+
// }
64+
// else{
65+
// toast.error("There is an error plz check you're information", toastOptions);
66+
// }
6067
}catch (error) {
6168
toast.error("Something going wrong", toastOptions);
6269
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /