Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
order-management-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
order-management-react
Commits
00d4f710
Commit
00d4f710
authored
May 07, 2021
by
Shanelle Valencia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AFP-24]
🚧
Fix search issues with backend data [
@svalencia
]
parent
b9757167
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
15 deletions
+31
-15
SearchOrder.tsx
src/components/SearchOrder.tsx
+29
-13
OrderIndexPage.tsx
src/pages/OrderIndexPage.tsx
+2
-2
No files found.
src/components/SearchOrder.tsx
View file @
00d4f710
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
Link
}
from
'react-router-dom'
// import { Order } from 'Order';
// import { useAllOrders } from 'hooks'
import
{
OrderDetails
}
from
'components'
import
{
Table
,
Thead
,
Tbody
,
Tfoot
,
Tr
,
Th
,
Td
,
TableCaption
,
}
from
"@chakra-ui/react"
...
...
@@ -27,6 +36,14 @@ const SearchOrder = (props: any) => {
setSearchResult
(
filtered
);
},
[
searchInput
]);
const
searchResultArr
=
searchResult
.
map
((
item
:
any
,
idx
)
=>
{
return
<
Tr
key=
{
idx
}
><
OrderDetails
date=
{
item
.
orderCreatedAt
}
orderNumber=
{
item
.
id
}
status=
{
item
.
orderStatus
}
/>
</
Tr
>
})
return
(
<
div
>
...
...
@@ -37,17 +54,16 @@ const SearchOrder = (props: any) => {
value=
{
searchInput
}
onChange=
{
handleSearchInput
}
/>
<
ul
>
{
searchResult
.
map
((
item
:
any
,
idx
)
=>
{
// debugger
return
(
<
li
key=
{
idx
}
>
<
Link
to=
{
"/orders/"
+
item
.
id
}
>
{
item
.
id
}
</
Link
>
</
li
>
)
})
}
</
ul
>
<
Table
variant=
"striped"
colorScheme=
"linkedin"
size=
"lg"
>
<
Tbody
>
<
Tr
>
{
/* <Th>Order number</Th>
<Th>Created</Th>
<Th>Order Status</Th> */
}
</
Tr
>
{
searchResultArr
}
</
Tbody
>
</
Table
>
</
div
>
);
}
...
...
src/pages/OrderIndexPage.tsx
View file @
00d4f710
...
...
@@ -19,11 +19,11 @@ const OrderIndexPage = () => {
const
orderDetailsArr
=
orders
.
map
((
order
:
Order
,
idx
:
any
)
=>
{
return
<
t
r
key=
{
idx
}
><
OrderDetails
return
<
T
r
key=
{
idx
}
><
OrderDetails
date=
{
order
.
orderCreatedAt
}
orderNumber=
{
order
.
id
}
status=
{
order
.
orderStatus
}
/></
t
r
>
/></
T
r
>
})
return
(
...
...
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