Commit d01a7bd5 authored by snamdeo's avatar snamdeo

commiting after making some small ui changes

parent 46f2ed24
...@@ -80,7 +80,10 @@ export default function Basket(props) { ...@@ -80,7 +80,10 @@ export default function Basket(props) {
<div <div
className="row" className="row"
onClick={() => { onClick={() => {
console.log(cartDetails.reference) document.getElementById("hiddenSpan").style.display =
"inline-block";
document.getElementById("cancelButtonId").style.display =
"inline-block";
axios axios
.post("http://localhost:8080/api/v1/addProducts", cartDetails) .post("http://localhost:8080/api/v1/addProducts", cartDetails)
.then((response) => { .then((response) => {
...@@ -88,8 +91,7 @@ export default function Basket(props) { ...@@ -88,8 +91,7 @@ export default function Basket(props) {
// alert("post is successfull"); // alert("post is successfull");
} }
}); });
document.getElementById("hiddenSpan").style.display =
"inline-block";
}} }}
> >
<StripeCheckout <StripeCheckout
...@@ -100,15 +102,18 @@ export default function Basket(props) { ...@@ -100,15 +102,18 @@ export default function Basket(props) {
amount={totalPrice + "00"} amount={totalPrice + "00"}
/> />
<br /> <br />
<span id="hiddenSpan"> </div>
<br/>
<span id="hiddenSpan">
Order {cartDetails.orderNumber} is placed successfully Order {cartDetails.orderNumber} is placed successfully
</span> </span>
</div> <br/>
<br /> <br />
<button className = "disabled"onClick={() => { <button id = "cancelButtonId" onClick={() => {
let newValetAmt = (parseInt(localStorage.getItem("valetAmount")) + itemsPrice) let newValetAmt = (parseInt(localStorage.getItem("valetAmount")) + itemsPrice)
localStorage.setItem("valetAmount",newValetAmt) localStorage.setItem("valetAmount",newValetAmt)
console.log("New Valet Amount", newValetAmt); document.getElementById("hiddenSpan").style.display =
"none";
const newValetAmount = { const newValetAmount = {
newValetAmt:newValetAmt newValetAmt:newValetAmt
} }
...@@ -119,7 +124,12 @@ export default function Basket(props) { ...@@ -119,7 +124,12 @@ export default function Basket(props) {
// alert("post is successfull"); // alert("post is successfull");
} }
}); });
document.getElementById("hiddenSpanForCancel").style.display =
"inline-block";
}}>Cancel Order</button> }}>Cancel Order</button>
<span id="hiddenSpanForCancel">
Order is cancelled and the amount of Rs. {itemsPrice} is successfully added in your valet
</span>
</> </>
)} )}
</div> </div>
......
...@@ -98,6 +98,12 @@ button.remove{ ...@@ -98,6 +98,12 @@ button.remove{
position:fixed; position:fixed;
} }
.addDisable{ #hiddenSpanForCancel{
disabled:true display: none;
color: red;
font-weight: bold;
}
#cancelButtonId{
display: none;
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment