Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
warehouse-management
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
1
Merge Requests
1
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
warehouse-management
Commits
15edcb2a
Commit
15edcb2a
authored
May 06, 2021
by
Darrick Yong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor with button atom
parent
6fdd862c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
37 deletions
+47
-37
filter.css
frontend/public/stylesheets/filter.css
+12
-3
Button.jsx
frontend/src/components/atoms/Button.jsx
+7
-0
Filter.jsx
frontend/src/components/filter/Filter.jsx
+24
-21
OrderButtons.jsx
frontend/src/components/order/OrderButtons.jsx
+3
-12
OrderIndexItem.jsx
frontend/src/components/order/OrderIndexItem.jsx
+1
-1
No files found.
frontend/public/stylesheets/filter.css
View file @
15edcb2a
.filter
{
width
:
50%
;
/* width: 50%; */
display
:
flex
;
justify-content
:
space-evenly
;
align-items
:
center
;
padding
:
20px
;
}
.filter
>
*
{
.filter-btns
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
}
.filter-btns
>
*
{
cursor
:
pointer
;
display
:
flex
;
padding
:
10px
20px
;
margin-left
:
10px
;
border-radius
:
5px
;
border
:
1px
solid
black
;
}
...
...
@@ -24,9 +31,11 @@
.filter-rec.selected
{
background
:
blue
;
}
.filter-ful.selected
{
background
:
green
;
}
.filter-can.selected
{
background
:
red
;
}
\ No newline at end of file
frontend/src/components/atoms/Button.jsx
0 → 100644
View file @
15edcb2a
const
Button
=
({
className
,
onClick
,
text
})
=>
(
<
div
className=
{
className
}
onClick=
{
onClick
}
>
{
text
}
</
div
>
)
export
default
Button
;
\ No newline at end of file
frontend/src/components/filter/Filter.jsx
View file @
15edcb2a
import
{
useEffect
,
useState
}
from
"react"
;
import
Button
from
"../atoms/Button"
;
const
Filter
=
({
orders
,
setOrdersToShow
})
=>
{
const
[
all
,
setAll
]
=
useState
(
true
);
...
...
@@ -77,27 +78,29 @@ const Filter = ({ orders, setOrdersToShow }) => {
return
(
<
div
className=
"filter"
>
Filter:
<
div
className=
{
`filter-all ${all ? "selected" : ""}`
}
onClick=
{
reset
}
>
All
</
div
>
<
div
<
div
>
Filter:
</
div
>
<
div
className=
"filter-btns"
>
<
Button
className=
{
`filter-all ${all ? "selected" : ""}`
}
onClick=
{
reset
}
text=
"All"
/>
<
Button
className=
{
`filter-rec ${received ? "selected" : ""}`
}
onClick=
{
receive
}
>
Received
</
div
>
<
div
text=
"Received"
/>
<
Button
className=
{
`filter-ful ${fulfilled ? "selected" : ""}`
}
onClick=
{
fulfill
}
>
Fulfilled
</
div
>
<
div
text=
"Fulfilled"
/>
<
Button
className=
{
`filter-can ${cancelled ? "selected" : ""}`
}
onClick=
{
cancel
}
>
Cancelled
text=
"Cancelled"
/>
</
div
>
</
div
>
);
...
...
frontend/src/components/order/OrderButtons.jsx
View file @
15edcb2a
import
React
from
"react"
;
import
{
connect
}
from
"react-redux"
;
import
{
editOrder
}
from
"../../actions/order_actions"
;
import
Button
from
"../atoms/Button"
;
const
OrderButtons
=
({
order
,
editOrder
})
=>
{
// const { id, orderId, status, orderItems, createdAt, modifiedAt } = order;
...
...
@@ -14,20 +15,10 @@ const OrderButtons = ({ order, editOrder }) => {
}
};
const
fulfill
=
(
<
div
className=
"fulfill-btn"
onClick=
{
()
=>
handleUpdate
(
"FULFILL"
)
}
>
Fulfill
</
div
>
);
const
cancel
=
(
<
div
className=
"cancel-btn"
onClick=
{
()
=>
handleUpdate
(
"CANCEL"
)
}
>
Cancel
</
div
>
);
return
(
<
div
className=
"oii-buttons"
>
{
fulfill
}
{
cancel
}
<
Button
className=
"fulfill-btn"
onClick=
{
()
=>
handleUpdate
(
"FULFILL"
)
}
text=
"Fulfill"
/>
<
Button
className=
"cancel-btn"
onClick=
{
()
=>
handleUpdate
(
"CANCEL"
)
}
text=
"Cancel"
/>
</
div
>
);
};
...
...
frontend/src/components/order/OrderIndexItem.jsx
View file @
15edcb2a
...
...
@@ -26,7 +26,7 @@ const OrderIndexItem = ({ order }) => {
<
div
className=
"oii-container"
>
<
div
className=
"oii-left"
>
<
FiChevronRight
className=
{
`oii-drop ${showDetails ? "rotate" : ""}`
}
onClick=
{
()
=>
setShowDetails
(
!
showDetails
)
}
/>
<
div
className=
"oii-num"
>
{
`Order #:
${orderId}`
}
{
id
}
</
div
>
<
div
className=
"oii-num"
>
{
`Order #:
${orderId} --`
}
{
`Warehouse #:${id}`
}
</
div
>
</
div
>
{
actions
}
</
div
>
...
...
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