Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ecommerce-maven
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ascend
ecommerce-maven
Commits
e52a57c8
Commit
e52a57c8
authored
May 10, 2021
by
Shaphen Pangburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AFP-48 Shaphen Pangburn]: Comment unused code and add handlesubmit functionality to product page
parent
c5334f96
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
34 additions
and
34 deletions
+34
-34
header.js
ecom-web/src/components/Header/header.js
+1
-1
PaymentMethod.js
ecom-web/src/components/checkout/PaymentMethod.js
+1
-1
ReviewOrder.js
ecom-web/src/components/checkout/ReviewOrder.js
+1
-1
ShippingAddress.js
ecom-web/src/components/checkout/ShippingAddress.js
+1
-1
SubmitOrder.js
ecom-web/src/components/checkout/SubmitOrder.js
+1
-1
checkout.jsx
ecom-web/src/components/checkout/checkout.jsx
+5
-5
product-details.jsx
ecom-web/src/components/product-market/product-details.jsx
+2
-2
product-item.jsx
ecom-web/src/components/product-market/product-item.jsx
+9
-4
product-market.css
ecom-web/src/resources/stylesheets/product-market.css
+13
-18
No files found.
ecom-web/src/components/Header/header.js
View file @
e52a57c8
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
Nav
from
'react-bootstrap/Nav'
import
Nav
from
'react-bootstrap/Nav'
import
Navbar
from
'react-bootstrap/Navbar'
import
Navbar
from
'react-bootstrap/Navbar'
import
NavDropdown
from
'react-bootstrap/NavDropdown'
//
import NavDropdown from 'react-bootstrap/NavDropdown'
import
{
NavLink
}
from
'react-router-dom'
import
{
NavLink
}
from
'react-router-dom'
import
Session
from
'../session/session-container'
import
Session
from
'../session/session-container'
...
...
ecom-web/src/components/checkout/PaymentMethod.js
View file @
e52a57c8
import
React
,
{
useState
,
useEffect
}
from
'react'
//
import React, {useState, useEffect} from 'react'
export
default
function
PaymentMethod
()
{
export
default
function
PaymentMethod
()
{
return
(
return
(
...
...
ecom-web/src/components/checkout/ReviewOrder.js
View file @
e52a57c8
import
React
,
{
useState
,
useEffect
}
from
'react'
//
import React, {useState, useEffect} from 'react'
export
default
function
ReviewOrder
()
{
export
default
function
ReviewOrder
()
{
return
(
return
(
...
...
ecom-web/src/components/checkout/ShippingAddress.js
View file @
e52a57c8
import
React
,
{
useState
,
useEffect
}
from
'react'
//
import React, {useState, useEffect} from 'react'
export
default
function
ShippingAddress
()
{
export
default
function
ShippingAddress
()
{
return
(
return
(
...
...
ecom-web/src/components/checkout/SubmitOrder.js
View file @
e52a57c8
import
React
,
{
useState
,
useEffect
}
from
'react'
//
import React, {useState, useEffect} from 'react'
export
default
function
SubmitOrder
()
{
export
default
function
SubmitOrder
()
{
return
(
return
(
...
...
ecom-web/src/components/checkout/checkout.jsx
View file @
e52a57c8
import
React
,
{
useState
,
useEffect
}
from
'react'
//
import React, {useState, useEffect} from 'react'
import
ShippingAddress
from
'./ShippingAddress.js'
//
import ShippingAddress from './ShippingAddress.js'
import
PaymentMethod
from
'./PaymentMethod.js'
//
import PaymentMethod from './PaymentMethod.js'
import
ReviewOrder
from
'./ReviewOrder.js'
//
import ReviewOrder from './ReviewOrder.js'
import
SubmitOrder
from
'./SubmitOrder.js'
//
import SubmitOrder from './SubmitOrder.js'
export
default
function
checkout
()
{
export
default
function
checkout
()
{
...
...
ecom-web/src/components/product-market/product-details.jsx
View file @
e52a57c8
...
@@ -39,8 +39,8 @@ export default class ProductDetails extends Component {
...
@@ -39,8 +39,8 @@ export default class ProductDetails extends Component {
:
:
<
p
id=
"prod-details-original-price"
>
Price: $
{
this
.
props
.
product
.
price
}
</
p
>
<
p
id=
"prod-details-original-price"
>
Price: $
{
this
.
props
.
product
.
price
}
</
p
>
}
}
<
input
type=
"number"
id
=
"prod-details-quantity"
placeholder=
"Quantity"
/>
<
input
type=
"number"
className
=
"prod-details-quantity"
placeholder=
"Quantity"
/>
<
button
id
=
"prod-details-add-to-cart"
>
<
button
className
=
"prod-details-add-to-cart"
>
Add to Cart
Add to Cart
</
button
>
</
button
>
</
div
>
</
div
>
...
...
ecom-web/src/components/product-market/product-item.jsx
View file @
e52a57c8
...
@@ -9,6 +9,7 @@ export default class ProductItem extends Component {
...
@@ -9,6 +9,7 @@ export default class ProductItem extends Component {
this
.
state
=
{
this
.
state
=
{
showDetailsModal
:
false
showDetailsModal
:
false
}
}
this
.
handleSubmit
=
this
.
handleSubmit
.
bind
(
this
);
this
.
toggleDetailsModal
=
this
.
toggleDetailsModal
.
bind
(
this
);
this
.
toggleDetailsModal
=
this
.
toggleDetailsModal
.
bind
(
this
);
}
}
...
@@ -20,6 +21,10 @@ export default class ProductItem extends Component {
...
@@ -20,6 +21,10 @@ export default class ProductItem extends Component {
calculateDiscount
(
price
,
discount
)
{
calculateDiscount
(
price
,
discount
)
{
return
(
price
*
((
100
-
discount
)
/
100
)).
toFixed
(
2
);
return
(
price
*
((
100
-
discount
)
/
100
)).
toFixed
(
2
);
}
}
handleSubmit
(
e
,
product
)
{
e
.
preventDefault
();
}
render
()
{
render
()
{
let
discount
=
this
.
calculateDiscount
(
this
.
props
.
item
.
price
,
this
.
props
.
item
.
promo
)
let
discount
=
this
.
calculateDiscount
(
this
.
props
.
item
.
price
,
this
.
props
.
item
.
promo
)
...
@@ -50,10 +55,10 @@ export default class ProductItem extends Component {
...
@@ -50,10 +55,10 @@ export default class ProductItem extends Component {
<
p
id=
"prod-promotion"
>
<
p
id=
"prod-promotion"
>
{
"Save "
+
this
.
props
.
item
.
promo
+
"% on this item!"
}
{
"Save "
+
this
.
props
.
item
.
promo
+
"% on this item!"
}
</
p
>
:
""
}
</
p
>
:
""
}
<
div
className=
"add-cart-and-quantity"
>
<
form
onSubmit=
{
e
=>
this
.
handleSubmit
(
e
,
this
.
props
.
item
)
}
className=
"add-cart-and-quantity"
>
<
input
id
=
"order-quantity"
type=
"number"
placeholder=
"Qty"
/>
<
input
className
=
"order-quantity"
type=
"number"
placeholder=
"Qty"
/>
<
span
id=
"add-to-cart-button"
>
Add to Cart
</
spa
n
>
<
button
className=
"add-to-cart-button"
>
Add to Cart
</
butto
n
>
</
div
>
</
form
>
<
Modal
<
Modal
id=
"product-details-modal"
id=
"product-details-modal"
...
...
ecom-web/src/resources/stylesheets/product-market.css
View file @
e52a57c8
...
@@ -107,7 +107,7 @@
...
@@ -107,7 +107,7 @@
color
:
red
;
color
:
red
;
}
}
#
add-to-cart-button
{
.
add-to-cart-button
{
cursor
:
pointer
;
cursor
:
pointer
;
margin-bottom
:
10px
;
margin-bottom
:
10px
;
padding
:
5px
40px
;
padding
:
5px
40px
;
...
@@ -118,7 +118,7 @@
...
@@ -118,7 +118,7 @@
transition
:
all
0.3s
;
transition
:
all
0.3s
;
}
}
#
add-to-cart-button
:hover
{
.
add-to-cart-button
:hover
{
background-color
:
rgb
(
207
,
205
,
205
);
background-color
:
rgb
(
207
,
205
,
205
);
}
}
...
@@ -149,24 +149,19 @@
...
@@ -149,24 +149,19 @@
padding-top
:
2px
;
padding-top
:
2px
;
}
}
#
order-quantity
{
.
order-quantity
{
width
:
23px
;
border
:
1px
dotted
rgba
(
0
,
0
,
0
,
0.3
)
;
height
:
13px
;
color
:
rgb
(
29
,
29
,
29
)
;
border-radius
:
5px
;
border-radius
:
5px
;
margin-top
:
2px
;
margin
:
1px
5px
;
margin
:
1px
5px
;
padding
:
6px
;
}
#order-quantity
{
border
:
1px
dotted
rgba
(
0
,
0
,
0
,
0.3
);
outline
:
none
;
outline
:
none
;
width
:
42px
;
height
:
30px
;
height
:
30px
;
margin-top
:
2
px
;
padding
:
6
px
;
color
:
rgb
(
29
,
29
,
29
)
;
width
:
42px
;
transition
:
all
0.5s
;
transition
:
all
0.5s
;
}
}
#
order-quantity
:focus
{
.
order-quantity
:focus
{
border
:
1px
solid
black
;
border
:
1px
solid
black
;
}
}
...
@@ -294,7 +289,7 @@
...
@@ -294,7 +289,7 @@
width
:
100%
;
width
:
100%
;
}
}
#
prod-details-quantity
{
.
prod-details-quantity
{
border
:
1px
dotted
rgba
(
0
,
0
,
0
,
0.3
);
border
:
1px
dotted
rgba
(
0
,
0
,
0
,
0.3
);
border-radius
:
5px
;
border-radius
:
5px
;
outline
:
none
;
outline
:
none
;
...
@@ -303,11 +298,11 @@
...
@@ -303,11 +298,11 @@
transition
:
all
0.5s
;
transition
:
all
0.5s
;
}
}
#
prod-details-quantity
:focus
{
.
prod-details-quantity
:focus
{
border
:
1px
solid
black
;
border
:
1px
solid
black
;
}
}
#
prod-details-add-to-cart
{
.
prod-details-add-to-cart
{
cursor
:
pointer
;
cursor
:
pointer
;
padding
:
5px
40px
;
padding
:
5px
40px
;
margin
:
10px
3px
;
margin
:
10px
3px
;
...
@@ -319,7 +314,7 @@
...
@@ -319,7 +314,7 @@
transition
:
all
0.3s
;
transition
:
all
0.3s
;
}
}
#
prod-details-add-to-cart
:hover
{
.
prod-details-add-to-cart
:hover
{
background-color
:
rgb
(
207
,
205
,
205
);
background-color
:
rgb
(
207
,
205
,
205
);
}
}
...
...
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