Changeset 55ed171 for frontend/src/screens
- Timestamp:
- 10/15/22 15:28:57 (2 years ago)
- Branches:
- master
- Children:
- 113029b
- Parents:
- ee05663
- Location:
- frontend/src/screens
- Files:
-
- 6 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/screens/CardPaymentScreen.js
ree05663 r55ed171 41 41 cart.totalPrice = cart.itemsPrice + cart.shippingPrice; 42 42 43 const [cardNumber, setCardNumber] = useState(""); 44 const handleChange = (event) => { 45 const result = event.target.value.replace(/[^0-9]/gi, ""); 46 setCardNumber(result); 47 }; 48 const [ccvNumber, setCcvNumber] = useState(""); 49 const handleChangeCCV = (event) => { 50 const result = event.target.value.replace(/[^0-9]/gi, ""); 51 console.log(event.currentTarget.validity.valid); 52 53 setCcvNumber(result); 54 }; 43 55 const paymentHandler = async (event) => { 44 56 event.preventDefault(); 45 57 const form = event.currentTarget; 46 58 if (form.checkValidity() === false) { 59 event.preventDefault(); 60 event.stopPropagation(); 61 } 62 if (cardNumber.length !== 16) { 47 63 event.preventDefault(); 48 64 event.stopPropagation(); … … 63 79 isPaid: true, 64 80 paidAt: Date.now(), 81 isConfirmed: true, 82 contactNumber: userInfo.contact, 65 83 }, 66 84 { … … 95 113 <Form.Group id="nameInput"> 96 114 <Form.Label>Име и Презиме</Form.Label> 97 <Form.Control 98 type="text" 99 //value={holderName} 100 // onChange={(e) => setHolderName(e.target.value)} 101 required 102 ></Form.Control> 115 <Form.Control type="text" required></Form.Control> 103 116 </Form.Group> 104 117 <Form.Group> … … 106 119 <Form.Control 107 120 type="text" 108 //value={cardNumber} 109 //onChange={(e) => setCardNumber(e.target.value)} 121 minLength="16" 122 maxLength="16" 123 value={cardNumber} 124 onChange={handleChange} 110 125 required 111 126 ></Form.Control> … … 115 130 <Form.Control 116 131 type="text" 117 //value={cvv} 118 //onChange={(e) => setCvv(e.target.value)} 132 minLength={3} 133 maxLength={3} 134 value={ccvNumber} 135 onChange={handleChangeCCV} 119 136 required 120 137 ></Form.Control> -
frontend/src/screens/OrderHistoryScreen.js
ree05663 r55ed171 10 10 import CheckIcon from "@mui/icons-material/Check"; 11 11 import ClearIcon from "@mui/icons-material/Clear"; 12 import PhonePausedIcon from "@mui/icons-material/PhonePaused"; 13 import LocalShippingIcon from "@mui/icons-material/LocalShipping"; 12 14 const reducer = (state, action) => { 13 15 switch (action.type) { … … 49 51 50 52 return ( 51 <div className="pageContainer shipPC" >53 <div className="pageContainer shipPC" style={{ justifyContent: "normal" }}> 52 54 <Helmet> 53 55 <title>Историја на нарачки</title> … … 82 84 {order.isDelivered ? ( 83 85 <CheckIcon></CheckIcon> 86 ) : order.isShipped ? ( 87 <LocalShippingIcon></LocalShippingIcon> 84 88 ) : ( 85 < ClearIcon></ClearIcon>89 <PhonePausedIcon></PhonePausedIcon> 86 90 )} 87 91 </td> -
frontend/src/screens/OrderScreen.js
ree05663 r55ed171 84 84 Доставено на {order.deliveredAt} 85 85 </MessageBox> 86 ) : order.isShipped ? ( 87 <MessageBox variant="primary"> 88 Вашата нарачка е испратена. 89 </MessageBox> 90 ) : order.isConfirmed ? ( 91 <MessageBox variant="primary"> 92 Вашата нарачка се процесира. 93 </MessageBox> 86 94 ) : ( 87 <MessageBox variant="danger">Не е доставено</MessageBox> 95 <MessageBox variant="danger"> 96 Потребно е да ја потврдите нарачката. Ќе бидете контактирани 97 преку телефонскиот број оставен за контакт. 98 </MessageBox> 88 99 )} 89 100 </Card.Body> -
frontend/src/screens/PlaceOrderScreen.js
ree05663 r55ed171 60 60 shippingPrice: cart.shippingPrice, 61 61 totalPrice: cart.totalPrice, 62 isConfirmed: false, 63 contactNumber: userInfo.contact, 62 64 }, 63 65 { -
frontend/src/screens/ProductScreen.js
ree05663 r55ed171 72 72 <img src={product.sideImage} alt={product.name}></img> 73 73 </div> 74 <div className="sideImg"> 75 <img src={product.sideImage2} alt={product.name}></img> 76 </div> 74 77 </div> 75 78 </div> -
frontend/src/screens/ProductScreenBootstrap.js
ree05663 r55ed171 165 165 onClick={changePhoto} 166 166 ></img> 167 168 <img 169 id="sec" 170 src={product.sideImage2} 171 alt={product.name} 172 onClick={changePhoto} 173 ></img> 167 174 </Row> 168 175 -
frontend/src/screens/SigninScreen.js
ree05663 r55ed171 32 32 ctxDispatch({ type: "USER_SIGNIN", payload: data }); 33 33 localStorage.setItem("userInfo", JSON.stringify(data)); 34 navigate(redirect || "/"); 34 if (data.isAdmin) navigate("/admin/dashboard"); 35 else navigate(redirect || "/"); 35 36 } catch (err) { 36 37 toast.error(getError(err));
Note:
See TracChangeset
for help on using the changeset viewer.