Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
inventory-promotion-react
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
inventory-promotion-react
Commits
59209607
Commit
59209607
authored
May 10, 2021
by
Ben Anderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed duplocate close button
parent
07064059
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10074 additions
and
10474 deletions
+10074
-10474
Product.jsx
src/component/Product.jsx
+53
-49
yarn.lock
yarn.lock
+10021
-10425
No files found.
src/component/Product.jsx
View file @
59209607
import
React
,
{
useState
}
from
'react'
import
'./../styles/Product.css'
import
React
,
{
useState
}
from
"react"
;
import
"./../styles/Product.css"
;
import
{
Modal
,
Button
,
Alert
}
from
"react-bootstrap"
;
export
default
function
Product
({
product
})
{
...
...
@@ -9,63 +9,67 @@ export default function Product({ product }) {
const
handleClose
=
()
=>
{
setShow
(
false
);
handleCloseConfirm
();
}
}
;
const
handleShow
=
()
=>
setShow
(
true
);
const
handleShowConfirm
=
()
=>
setShowConfirm
(
true
);
const
handleCloseConfirm
=
()
=>
setShowConfirm
(
false
);
return
(<
div
>
<
div
className=
"img-container"
onClick=
{
handleShow
}
>
<
img
className=
"grid-img"
src=
{
product
.
productImageUrl
}
alt=
{
product
.
productName
}
/>
</
div
>
<
div
className=
"prod-info"
>
<
h5
>
{
product
.
productName
}
</
h5
>
{
product
.
sku
}
<
br
/>
$
{
product
.
price
}
<
br
/>
In Stock:
{
product
.
stock
}
</
div
>
return
(
<
div
>
<
div
className=
"img-container"
onClick=
{
handleShow
}
>
<
img
className=
"grid-img"
src=
{
product
.
productImageUrl
}
alt=
{
product
.
productName
}
/>
</
div
>
<
div
className=
"prod-info"
>
<
h5
>
{
product
.
productName
}
</
h5
>
{
product
.
sku
}
<
br
/>
$
{
product
.
price
}
<
br
/>
In Stock:
{
product
.
stock
}
</
div
>
<
Modal
show=
{
show
}
onHide=
{
handleClose
}
>
<
Modal
.
Header
closeButton
>
<
Modal
.
Title
>
{
product
.
productName
}
</
Modal
.
Title
>
</
Modal
.
Header
>
<
Modal
show=
{
show
}
onHide=
{
handleClose
}
>
<
Modal
.
Header
closeButton
>
<
Modal
.
Title
>
{
product
.
productName
}
</
Modal
.
Title
>
</
Modal
.
Header
>
<
Modal
.
Body
>
<
div
className=
"modal-img"
>
<
img
src=
{
product
.
productImageUrl
}
alt=
{
product
.
productName
}
/>
</
div
>
<
h5
>
{
product
.
sku
}
</
h5
>
$
{
product
.
price
}
<
br
/>
{
product
.
productDescription
}
<
br
/>
<
Modal
.
Body
>
<
div
className=
"modal-img"
>
<
img
src=
{
product
.
productImageUrl
}
alt=
{
product
.
productName
}
/>
</
div
>
<
h5
>
{
product
.
sku
}
</
h5
>
$
{
product
.
price
}
<
br
/>
{
product
.
productDescription
}
<
br
/>
In Stock:
{
product
.
stock
}
</
Modal
.
Body
>
<
Modal
.
Footer
>
<
Button
variant=
"danger"
className=
"float-left"
onClick=
{
handleShowConfirm
}
>
Delete product
</
Button
>
</
Modal
.
Body
>
<
Button
variant=
"secondary"
onClick=
{
handleClose
}
>
Close
<
Modal
.
Footer
>
<
Button
variant=
"danger"
className=
"float-left"
onClick=
{
handleShowConfirm
}
>
Delete product
</
Button
>
<
Button
variant=
"primary"
onClick=
{
handleClose
}
>
Edit Product
</
Button
>
<
Alert
show=
{
showConfirm
}
variant=
"danger"
>
<
h5
>
Are you sure?
</
h5
>
<
Button
variant=
"secondary"
onClick=
{
handleCloseConfirm
}
>
Cancel
</
Button
>
<
Button
variant=
"danger"
>
Yes, delete
<
Button
variant=
"primary"
onClick=
{
handleClose
}
>
Edit Product
</
Button
>
</
Alert
>
</
Modal
.
Footer
>
</
Modal
>
</
div
>
)
<
Alert
show=
{
showConfirm
}
variant=
"danger"
>
<
h5
>
Are you sure?
</
h5
>
<
Button
variant=
"secondary"
onClick=
{
handleCloseConfirm
}
>
Cancel
</
Button
>
<
Button
variant=
"danger"
>
Yes, delete
</
Button
>
</
Alert
>
</
Modal
.
Footer
>
</
Modal
>
</
div
>
);
}
yarn.lock
View file @
59209607
This diff is collapsed.
Click to expand it.
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