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
a6fee5bc
Commit
a6fee5bc
authored
May 10, 2021
by
Ben Anderson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'AFP-11' into dev
parents
2971e4f7
59209607
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
109 additions
and
44 deletions
+109
-44
Product.jsx
src/component/Product.jsx
+69
-13
Product.css
src/styles/Product.css
+15
-1
yarn.lock
yarn.lock
+25
-30
No files found.
src/component/Product.jsx
View file @
a6fee5bc
import
React
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
})
{
export
default
function
Product
({
product
})
{
const
[
show
,
setShow
]
=
useState
(
false
);
const
[
showConfirm
,
setShowConfirm
]
=
useState
(
false
);
const
handleClose
=
()
=>
{
setShow
(
false
);
handleCloseConfirm
();
};
const
handleShow
=
()
=>
setShow
(
true
);
const
handleShowConfirm
=
()
=>
setShowConfirm
(
true
);
const
handleCloseConfirm
=
()
=>
setShowConfirm
(
false
);
return
(
<
div
>
<
div
className=
"img-container"
>
<
img
src=
{
product
.
productImageUrl
}
alt=
{
product
.
productName
}
/>
<
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
/>
{
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
.
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
>
<
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
>
</
Alert
>
</
Modal
.
Footer
>
</
Modal
>
</
div
>
)
)
;
}
src/styles/Product.css
View file @
a6fee5bc
img
{
max-width
:
100%
;
max-height
:
250px
;
}
.img-container
{
position
:
relative
;
overflow
:
hidden
;
padding-bottom
:
100%
;
}
img
{
.grid-
img
{
position
:
absolute
;
max-width
:
100%
;
max-height
:
100%
;
...
...
@@ -11,3 +16,12 @@ img {
left
:
50%
;
transform
:
translateX
(
-50%
)
translateY
(
-50%
);
}
.modal-img
{
display
:
flex
;
justify-content
:
center
;
}
.alert
{
width
:
100%
;
}
\ No newline at end of file
yarn.lock
View file @
a6fee5bc
...
...
@@ -1411,17 +1411,17 @@
"@popperjs/core@^2.8.6":
version "2.9.2"
resolved "https://registry.
yarnpkg.com/@popperjs/core/-/core-2.9.2.tgz#adea7b6953cbb34651766b0548468e743c6a2353
"
resolved "https://registry.
npmjs.org/@popperjs/core/-/core-2.9.2.tgz
"
integrity sha512-VZMYa7+fXHdwIq1TDhSXoVmSPEGM/aa+6Aiq3nVVJ9bXr24zScr+NlKFKC3iPljA7ho/GAZr+d2jOf5GIRC30Q==
"@restart/context@^2.1.4":
version "2.1.4"
resolved "https://registry.
yarnpkg.com/@restart/context/-/context-2.1.4.tgz#a99d87c299a34c28bd85bb489cb07bfd23149c02
"
resolved "https://registry.
npmjs.org/@restart/context/-/context-2.1.4.tgz
"
integrity sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==
"@restart/hooks@^0.3.26":
version "0.3.26"
resolved "https://registry.
yarnpkg.com/@restart/hooks/-/hooks-0.3.26.tgz#ade155a7b0b014ef1073391dda46972c3a14a129
"
resolved "https://registry.
npmjs.org/@restart/hooks/-/hooks-0.3.26.tgz
"
integrity sha512-7Hwk2ZMYm+JLWcb7R9qIXk1OoUg1Z+saKWqZXlrvFwT3w6UArVNWgxYOzf+PJoK9zZejp8okPAKTctthhXLt5g==
dependencies:
lodash "^4.17.20"
...
...
@@ -1668,7 +1668,7 @@
"@types/classnames@^2.2.10":
version "2.3.1"
resolved "https://registry.
yarnpkg.com/@types/classnames/-/classnames-2.3.1.tgz#3c2467aa0f1a93f1f021e3b9bcf938bd5dfdc0dd
"
resolved "https://registry.
npmjs.org/@types/classnames/-/classnames-2.3.1.tgz
"
integrity sha512-zeOWb0JGBoVmlQoznvqXbE0tEC/HONsnoUNH19Hc96NFsTAwTXbTqb8FMYkru1F/iqp7a18Ws3nWJvtA1sHD1A==
dependencies:
classnames "*"
...
...
@@ -1713,7 +1713,7 @@
"@types/invariant@^2.2.33":
version "2.2.34"
resolved "https://registry.
yarnpkg.com/@types/invariant/-/invariant-2.2.34.tgz#05e4f79f465c2007884374d4795452f995720bbe
"
resolved "https://registry.
npmjs.org/@types/invariant/-/invariant-2.2.34.tgz
"
integrity sha512-lYUtmJ9BqUN688fGY1U1HZoWT1/Jrmgigx2loq4ZcJpICECm/Om3V314BxdzypO0u5PORKGMM6x0OXaljV1YFg==
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1":
...
...
@@ -1780,7 +1780,7 @@
"@types/prop-types@*", "@types/prop-types@^15.7.3":
version "15.7.3"
resolved "https://registry.
yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7
"
resolved "https://registry.
npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz
"
integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==
"@types/q@^1.5.1":
...
...
@@ -1790,14 +1790,14 @@
"@types/react-transition-group@^4.4.1":
version "4.4.1"
resolved "https://registry.
yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.1.tgz#e1a3cb278df7f47f17b5082b1b3da17170bd44b1
"
resolved "https://registry.
npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.1.tgz
"
integrity sha512-vIo69qKKcYoJ8wKCJjwSgCTM+z3chw3g18dkrDfVX665tMH7tmbDxEAnPdey4gTlwZz5QuHGzd+hul0OVZDqqQ==
dependencies:
"@types/react" "*"
"@types/react@*", "@types/react@>=16.9.11", "@types/react@>=16.9.35":
version "17.0.5"
resolved "https://registry.
yarnpkg.com/@types/react/-/react-17.0.5.tgz#3d887570c4489011f75a3fc8f965bf87d09a1bea
"
resolved "https://registry.
npmjs.org/@types/react/-/react-17.0.5.tgz
"
integrity sha512-bj4biDB9ZJmGAYTWSKJly6bMr4BLUiBrx9ujiJEoP9XIDY9CTaPGxE5QWN/1WjpPLzYF7/jRNnV2nNxNe970sw==
dependencies:
"@types/prop-types" "*"
...
...
@@ -1813,7 +1813,7 @@
"@types/scheduler@*":
version "0.16.1"
resolved "https://registry.
yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275
"
resolved "https://registry.
npmjs.org/@types/scheduler/-/scheduler-0.16.1.tgz
"
integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA==
"@types/source-list-map@*":
...
...
@@ -1847,7 +1847,7 @@
"@types/warning@^3.0.0":
version "3.0.0"
resolved "https://registry.
yarnpkg.com/@types/warning/-/warning-3.0.0.tgz#0d2501268ad8f9962b740d387c4654f5f8e23e52
"
resolved "https://registry.
npmjs.org/@types/warning/-/warning-3.0.0.tgz
"
integrity sha1-DSUBJorY+ZYrdA04fEZU9fjiPlI=
"@types/webpack-sources@*":
...
...
@@ -2528,7 +2528,7 @@ axe-core@^4.0.2:
axios@^0.21.1:
version "0.21.1"
resolved "https://registry.
yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8
"
resolved "https://registry.
npmjs.org/axios/-/axios-0.21.1.tgz
"
integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==
dependencies:
follow-redirects "^1.10.0"
...
...
@@ -2819,7 +2819,7 @@ boolbase@^1.0.0, boolbase@~1.0.0:
bootstrap@^5.0.0:
version "5.0.0"
resolved "https://registry.
yarnpkg.com/bootstrap/-/bootstrap-5.0.0.tgz#97635ac0e0d6cb466700ebf0fd266bfabf352ed2
"
resolved "https://registry.
npmjs.org/bootstrap/-/bootstrap-5.0.0.tgz
"
integrity sha512-tmhPET9B9qCl8dCofvHeiIhi49iBt0EehmIsziZib65k1erBW1rHhj2s/2JsuQh5Pq+xz2E9bEbzp9B7xHG+VA==
brace-expansion@^1.1.7:
...
...
@@ -3253,7 +3253,7 @@ class-utils@^0.3.5:
classnames@*, classnames@^2.2.6:
version "2.3.1"
resolved "https://registry.
yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e
"
resolved "https://registry.
npmjs.org/classnames/-/classnames-2.3.1.tgz
"
integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==
clean-css@^4.2.3:
...
...
@@ -3863,7 +3863,7 @@ cssstyle@^2.2.0:
csstype@^3.0.2:
version "3.0.8"
resolved "https://registry.
yarnpkg.com/csstype/-/csstype-3.0.8.tgz#d2266a792729fb227cd216fb572f43728e1ad340
"
resolved "https://registry.
npmjs.org/csstype/-/csstype-3.0.8.tgz
"
integrity sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw==
cyclist@^1.0.1:
...
...
@@ -4131,7 +4131,7 @@ dom-converter@^0.2:
dom-helpers@^5.0.1, dom-helpers@^5.1.2, dom-helpers@^5.2.0:
version "5.2.1"
resolved "https://registry.
yarnpkg.com/dom-helpers/-/dom-helpers-5.2.1.tgz#d9400536b2bf8225ad98fe052e029451ac40e902
"
resolved "https://registry.
npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz
"
integrity sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==
dependencies:
"@babel/runtime" "^7.8.7"
...
...
@@ -5026,16 +5026,11 @@ flush-write-stream@^1.0.0:
inherits "^2.0.3"
readable-stream "^2.3.6"
follow-redirects@^1.0.0:
follow-redirects@^1.0.0
, follow-redirects@^1.10.0
:
version "1.13.2"
resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.2.tgz"
integrity sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA==
follow-redirects@^1.10.0:
version "1.14.0"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.0.tgz#f5d260f95c5f8c105894491feee5dc8993b402fe"
integrity sha512-0vRwd7RKQBTt+mgu87mtYeofLFZpTas2S9zY+jIeuLJMNvudIgF52nr19q40HOwH5RrhWIPuj9puybzSJiRrVg==
for-in@^1.0.2:
version "1.0.2"
resolved "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz"
...
...
@@ -5780,7 +5775,7 @@ internal-slot@^1.0.3:
invariant@^2.2.4:
version "2.2.4"
resolved "https://registry.
yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6
"
resolved "https://registry.
npmjs.org/invariant/-/invariant-2.2.4.tgz
"
integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
dependencies:
loose-envify "^1.0.0"
...
...
@@ -6934,7 +6929,7 @@ locate-path@^5.0.0:
lodash-es@^4.17.20:
version "4.17.21"
resolved "https://registry.
yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee
"
resolved "https://registry.
npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz
"
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==
lodash._reinterpolate@^3.0.0:
...
...
@@ -8814,7 +8809,7 @@ prompts@2.4.0, prompts@^2.0.1:
prop-types-extra@^1.1.0:
version "1.1.1"
resolved "https://registry.
yarnpkg.com/prop-types-extra/-/prop-types-extra-1.1.1.tgz#58c3b74cbfbb95d304625975aa2f0848329a010b
"
resolved "https://registry.
npmjs.org/prop-types-extra/-/prop-types-extra-1.1.1.tgz
"
integrity sha512-59+AHNnHYCdiC+vMwY52WmvP5dM3QLeoumYuEyceQDi9aEhtwN9zIQ2ZNo25sMyXnbh32h+P1ezDsUpUH3JAew==
dependencies:
react-is "^16.3.2"
...
...
@@ -8998,7 +8993,7 @@ react-app-polyfill@^2.0.0:
react-bootstrap@^1.5.2:
version "1.5.2"
resolved "https://registry.
yarnpkg.com/react-bootstrap/-/react-bootstrap-1.5.2.tgz#07dabec53d10491a520c49f102170b440fa89008
"
resolved "https://registry.
npmjs.org/react-bootstrap/-/react-bootstrap-1.5.2.tgz
"
integrity sha512-mGKPY5+lLd7Vtkx2VFivoRkPT4xAHazuFfIhJLTEgHlDfIUSePn7qrmpZe5gXH9zvHV0RsBaQ9cLfXjxnZrOpA==
dependencies:
"@babel/runtime" "^7.13.8"
...
...
@@ -9081,12 +9076,12 @@ react-is@^17.0.1:
react-lifecycles-compat@^3.0.4:
version "3.0.4"
resolved "https://registry.
yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362
"
resolved "https://registry.
npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz
"
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==
react-overlays@^5.0.0:
version "5.0.1"
resolved "https://registry.
yarnpkg.com/react-overlays/-/react-overlays-5.0.1.tgz#7e2c3cd3c0538048b0b7451d203b1289c561b7f2
"
resolved "https://registry.
npmjs.org/react-overlays/-/react-overlays-5.0.1.tgz
"
integrity sha512-plwUJieTBbLSrgvQ4OkkbTD/deXgxiJdNuKzo6n1RWE3OVnQIU5hffCGS/nvIuu6LpXFs2majbzaXY8rcUVdWA==
dependencies:
"@babel/runtime" "^7.13.8"
...
...
@@ -9200,7 +9195,7 @@ react-scripts@4.0.3:
react-transition-group@^4.4.1:
version "4.4.1"
resolved "https://registry.
yarnpkg.com/react-transition-group/-/react-transition-group-4.4.1.tgz#63868f9325a38ea5ee9535d828327f85773345c9
"
resolved "https://registry.
npmjs.org/react-transition-group/-/react-transition-group-4.4.1.tgz
"
integrity sha512-Djqr7OQ2aPUiYurhPalTrVy9ddmFCCzwhqQmtN+J3+3DzLO209Fdr70QrN8Z3DsglWql6iY1lDWAfpFiBtuKGw==
dependencies:
"@babel/runtime" "^7.5.5"
...
...
@@ -10802,7 +10797,7 @@ typedarray@^0.0.6:
uncontrollable@^7.2.1:
version "7.2.1"
resolved "https://registry.
yarnpkg.com/uncontrollable/-/uncontrollable-7.2.1.tgz#1fa70ba0c57a14d5f78905d533cf63916dc75738
"
resolved "https://registry.
npmjs.org/uncontrollable/-/uncontrollable-7.2.1.tgz
"
integrity sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==
dependencies:
"@babel/runtime" "^7.6.3"
...
...
@@ -11070,7 +11065,7 @@ walker@^1.0.7, walker@~1.0.5:
warning@^4.0.0, warning@^4.0.3:
version "4.0.3"
resolved "https://registry.
yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3
"
resolved "https://registry.
npmjs.org/warning/-/warning-4.0.3.tgz
"
integrity sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==
dependencies:
loose-envify "^1.0.0"
...
...
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