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
e60ba407
Commit
e60ba407
authored
May 07, 2021
by
Sumaiyya Burney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Aligns products to a responsive grid
parent
c184820a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
26 deletions
+78
-26
.gitignore
.gitignore
+1
-0
Product.css
src/component/Product.css
+13
-0
Product.jsx
src/component/Product.jsx
+19
-0
ProductGrid.css
src/component/ProductGrid.css
+7
-0
ProductGrid.jsx
src/component/ProductGrid.jsx
+37
-26
index.js
src/index.js
+1
-0
No files found.
.gitignore
View file @
e60ba407
...
@@ -24,3 +24,4 @@ yarn-error.log*
...
@@ -24,3 +24,4 @@ yarn-error.log*
.env
.env
yarn.lock
src/component/Product.css
0 → 100644
View file @
e60ba407
.img-container
{
position
:
relative
;
overflow
:
hidden
;
padding-bottom
:
100%
;
}
img
{
position
:
absolute
;
max-width
:
100%
;
max-height
:
100%
;
top
:
50%
;
left
:
50%
;
transform
:
translateX
(
-50%
)
translateY
(
-50%
);
}
\ No newline at end of file
src/component/Product.jsx
0 → 100644
View file @
e60ba407
import
React
from
'react'
import
'./Product.css'
export
default
function
Product
({
product
})
{
return
(
<
div
>
<
div
className=
"img-container"
>
<
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
>
</
div
>
)
}
src/component/ProductGrid.css
0 → 100644
View file @
e60ba407
#title
{
margin-left
:
1em
;
}
#prod-grid
{
margin-left
:
2em
;
}
\ No newline at end of file
src/component/ProductGrid.jsx
View file @
e60ba407
import
React
from
'react'
import
React
from
'react'
import
Product
from
'./Product.jsx'
import
{
Col
,
Container
,
Row
}
from
'react-bootstrap'
;
import
'./ProductGrid.css'
export
default
function
ProductGrid
({
productData
})
{
export
default
function
ProductGrid
({
productData
})
{
return
(
return
(
<
div
>
//uses react bootstrap components
PRODUCT GRID
<
Container
id=
"prod-grid"
>
<
Row
xs=
{
1
}
sm=
{
2
}
md=
{
3
}
lg=
{
4
}
>
<
div
id=
"prod-grid"
>
{
productData
.
map
((
product
)
=>
{
<
table
>
return
(
<
tbody
>
<
Col
key=
{
product
.
sku
}
>
{
productData
.
map
((
product
)
=>
{
<
Product
product=
{
product
}
/>
return
(
</
Col
>
<
tr
>
)
<
td
><
img
src=
{
product
.
productImageUrl
}
alt=
"product"
/></
td
>
})
}
<
td
>
{
product
.
productName
}
</
td
>
</
Row
>
<
td
>
{
product
.
price
}
</
td
>
</
Container
>
<
td
>
{
product
.
sku
}
</
td
>
<
td
>
{
product
.
description
}
</
td
>
//uses vanilla bootstrap
</
tr
>
// <div>
)
// <h1 id="title">Inventory</h1>
})
}
// <div className="container" id="prod-grid" >
</
tbody
>
// <div className="row row-cols-4">
</
table
>
// {productData.map((product) => {
</
div
>
// return (
</
div
>
// <div className="col" key={product.sku}>
)
// <Product product={product}/>
}
// </div>
// )
// })}
// </div>
// </div>
// </div>
)
}
\ No newline at end of file
src/index.js
View file @
e60ba407
import
React
from
"react"
;
import
React
from
"react"
;
import
ReactDOM
from
"react-dom"
;
import
ReactDOM
from
"react-dom"
;
import
'bootstrap/dist/css/bootstrap.css'
;
import
"./index.css"
;
import
"./index.css"
;
import
App
from
"./App"
;
import
App
from
"./App"
;
import
reportWebVitals
from
"./reportWebVitals"
;
import
reportWebVitals
from
"./reportWebVitals"
;
...
...
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