Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FoodDeliveryReact
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
snamdeo
FoodDeliveryReact
Commits
d01a7bd5
Commit
d01a7bd5
authored
Sep 06, 2022
by
snamdeo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commiting after making some small ui changes
parent
46f2ed24
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
9 deletions
+26
-9
Basket.js
src/components/Basket.js
+17
-7
index.css
src/index.css
+9
-2
No files found.
src/components/Basket.js
View file @
d01a7bd5
...
...
@@ -80,7 +80,10 @@ export default function Basket(props) {
<
div
className
=
"row"
onClick
=
{()
=>
{
console
.
log
(
cartDetails
.
reference
)
document
.
getElementById
(
"hiddenSpan"
).
style
.
display
=
"inline-block"
;
document
.
getElementById
(
"cancelButtonId"
).
style
.
display
=
"inline-block"
;
axios
.
post
(
"http://localhost:8080/api/v1/addProducts"
,
cartDetails
)
.
then
((
response
)
=>
{
...
...
@@ -88,8 +91,7 @@ export default function Basket(props) {
// alert("post is successfull");
}
});
document
.
getElementById
(
"hiddenSpan"
).
style
.
display
=
"inline-block"
;
}}
>
<
StripeCheckout
...
...
@@ -100,15 +102,18 @@ export default function Basket(props) {
amount
=
{
totalPrice
+
"00"
}
/
>
<
br
/>
<
span
id
=
"hiddenSpan"
>
<
/div
>
<
br
/>
<
span
id
=
"hiddenSpan"
>
Order
{
cartDetails
.
orderNumber
}
is
placed
successfully
<
/span
>
<
/div
>
<
br
/
>
<
br
/>
<
button
className
=
"disabled"
onClick
=
{()
=>
{
<
button
id
=
"cancelButtonId"
onClick
=
{()
=>
{
let
newValetAmt
=
(
parseInt
(
localStorage
.
getItem
(
"valetAmount"
))
+
itemsPrice
)
localStorage
.
setItem
(
"valetAmount"
,
newValetAmt
)
console
.
log
(
"New Valet Amount"
,
newValetAmt
);
document
.
getElementById
(
"hiddenSpan"
).
style
.
display
=
"none"
;
const
newValetAmount
=
{
newValetAmt
:
newValetAmt
}
...
...
@@ -119,7 +124,12 @@ export default function Basket(props) {
// alert("post is successfull");
}
});
document
.
getElementById
(
"hiddenSpanForCancel"
).
style
.
display
=
"inline-block"
;
}}
>
Cancel
Order
<
/button
>
<
span
id
=
"hiddenSpanForCancel"
>
Order
is
cancelled
and
the
amount
of
Rs
.
{
itemsPrice
}
is
successfully
added
in
your
valet
<
/span
>
<
/
>
)}
<
/div
>
...
...
src/index.css
View file @
d01a7bd5
...
...
@@ -98,6 +98,12 @@ button.remove{
position
:
fixed
;
}
.addDisable
{
disabled
:
true
#hiddenSpanForCancel
{
display
:
none
;
color
:
red
;
font-weight
:
bold
;
}
#cancelButtonId
{
display
:
none
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment