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
7ed7c153
Commit
7ed7c153
authored
May 12, 2021
by
Sumaiyya Burney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes search results, delete from search is broken
parent
a207c9dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
22 deletions
+40
-22
SearchResults.jsx
src/component/SearchResults.jsx
+40
-22
No files found.
src/component/SearchResults.jsx
View file @
7ed7c153
import
React
from
"react"
;
import
{
Container
}
from
"react-bootstrap
"
;
// import "./../styles/ProductGrid.css
";
import
ProductTable
from
"./ProductTable.jsx
"
;
export
default
class
SearchResults
extends
React
.
Component
{
import
ProductRow
from
"./ProductRow.jsx
"
;
import
{
Table
}
from
"react-bootstrap
"
;
// import "./../styles/ProductTable.css
";
export
default
class
SearchResults
extends
React
.
Component
{
constructor
(
props
){
super
(
props
);
this
.
state
=
{
results
:
this
.
props
.
history
.
location
.
state
.
results
}
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
results
:
this
.
props
.
history
.
location
.
state
.
results
}
}
render
(){
return
(
<
div
>
<
h1
id=
"title"
className=
"text-center"
>
Search Results
</
h1
>
<
Container
id=
"prod-grid"
className=
"mt-3"
>
{
this
.
state
.
results
.
length
>
0
?
<
ProductTable
productData=
{
this
.
state
.
results
}
/>
:
<
p
>
Unable to find any matching products.
</
p
>
}
</
Container
>
</
div
>
);
}
render
()
{
return
(
<
div
className=
"container flex-column d-flex justify-content-center"
>
<
h1
id=
"title"
className=
"text-center"
>
Search Results
</
h1
>
{
this
.
state
.
results
.
length
>
0
?
<
Table
>
<
thead
>
<
tr
>
<
th
>
SKU
</
th
>
<
th
>
Product Name
</
th
>
<
th
>
Price
</
th
>
<
th
>
Category
</
th
>
<
th
>
Available Stock
</
th
>
<
th
>
Blocked Stock
</
th
>
<
th
>
Fulfilled Stock
</
th
>
</
tr
>
</
thead
>
<
tbody
>
{
this
.
state
.
results
.
map
((
product
)
=>
{
return
(
<
ProductRow
key=
{
product
.
sku
}
product=
{
product
}
/>
);
})
}
</
tbody
>
</
Table
>
:
<
p
>
Unable to find any matching products.
</
p
>
}
</
div
>
);
}
}
\ 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