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
ea447497
Commit
ea447497
authored
May 13, 2021
by
Shanelle Valencia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
💄
Style header with proper format and fix show page style
parent
3262e703
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
83 deletions
+89
-83
Nav.tsx
src/components/Nav.tsx
+12
-12
OrderShowDetails.tsx
src/components/OrderShowDetails.tsx
+15
-15
index.css
src/index.css
+29
-22
OrderIndexPage.tsx
src/pages/OrderIndexPage.tsx
+33
-34
No files found.
src/components/Nav.tsx
View file @
ea447497
...
@@ -3,7 +3,7 @@ import { Link } from 'react-router-dom'
...
@@ -3,7 +3,7 @@ import { Link } from 'react-router-dom'
import
{
useGoogleAuth
}
from
'hooks'
import
{
useGoogleAuth
}
from
'hooks'
import
{
FontAwesomeIcon
}
from
'@fortawesome/react-fontawesome'
import
{
FontAwesomeIcon
}
from
'@fortawesome/react-fontawesome'
import
{
faUser
}
from
'@fortawesome/free-solid-svg-icons'
import
{
faUser
}
from
'@fortawesome/free-solid-svg-icons'
import
{
Box
,
Heading
,
Flex
,
Spacer
,
Button
,
Image
,
Avatar
}
from
"@chakra-ui/react"
import
{
Box
,
Heading
,
Flex
,
Spacer
,
Button
,
Image
,
Avatar
,
HStack
}
from
"@chakra-ui/react"
import
Logo
from
'../img/logo.png'
import
Logo
from
'../img/logo.png'
...
@@ -17,13 +17,12 @@ const Nav = () => {
...
@@ -17,13 +17,12 @@ const Nav = () => {
return
(
return
(
<
div
>
<
div
>
<
Flex
className=
"header"
>
<
Flex
className=
"header"
>
{
/*
<Box className="left-nav">
<
Box
className=
"left-nav"
>
<Link to="/"><Image src={Logo} alt="project logo"height="
90%" width="80
%" /></Link>
<
Link
to=
"/"
><
Image
src=
{
Logo
}
alt=
"project logo"
height=
"
110%"
width=
"55
%"
/></
Link
>
</Box>
*/
}
</
Box
>
<
Spacer
/>
<
Spacer
/>
<
Flex
className=
"right-nav"
>
<
HStack
className=
"right-nav"
spacing=
"1px"
>
<
Link
className=
"nav-link"
to=
"/account"
>
{
userIcon
}
</
Link
>
<
Box
><
button
<
button
// p={2}
// p={2}
// size="sm"
// size="sm"
// color="white"
// color="white"
...
@@ -34,8 +33,9 @@ const Nav = () => {
...
@@ -34,8 +33,9 @@ const Nav = () => {
// bgGradient: "linear(to-r, blue.500, yellow.500)",
// bgGradient: "linear(to-r, blue.500, yellow.500)",
// }}
// }}
>
>
<
Link
to=
"/orders"
>
Orders
</
Link
></
button
>
<
Link
to=
"/orders"
>
Orders
</
Link
></
button
></
Box
>
<
button
<
Box
><
span
>
|
</
span
></
Box
>
<
Box
><
button
// p={2}
// p={2}
// size="sm"
// size="sm"
// color="white"
// color="white"
...
@@ -45,9 +45,9 @@ const Nav = () => {
...
@@ -45,9 +45,9 @@ const Nav = () => {
// _hover={{
// _hover={{
// bgGradient: "linear(to-r, blue.500, yellow.500)",
// bgGradient: "linear(to-r, blue.500, yellow.500)",
// }}
// }}
onClick=
{
handleAuth
}
>
{
authLinkText
}
</
button
></
Box
>
onClick=
{
handleAuth
}
>
{
authLinkText
}
</
button
>
<
Box
><
Link
className=
"nav-link"
to=
"/account"
>
{
userIcon
}
</
Link
></
Box
>
</
Flex
>
</
HStack
>
</
Flex
>
</
Flex
>
</
div
>
</
div
>
)
)
...
...
src/components/OrderShowDetails.tsx
View file @
ea447497
...
@@ -23,12 +23,12 @@ const OrderShowDetails = (props: any) => {
...
@@ -23,12 +23,12 @@ const OrderShowDetails = (props: any) => {
const
itemMap
=
(
items
:
Item
[])
=>
{
const
itemMap
=
(
items
:
Item
[])
=>
{
return
items
.
map
((
item
:
Item
,
idx
:
number
)
=>
{
return
items
.
map
((
item
:
Item
,
idx
:
number
)
=>
{
return
(
return
(
<
tr
key=
{
idx
}
>
<
Tr
key=
{
idx
}
>
<
Td
>
{
item
.
itemId
}
</
Td
>
<
Td
>
{
item
.
itemId
}
</
Td
>
<
Td
>
{
item
.
itemPrice
}
</
Td
>
<
Td
>
{
item
.
itemPrice
}
</
Td
>
<
Td
>
{
item
.
itemQuantity
}
</
Td
>
<
Td
>
{
item
.
itemQuantity
}
</
Td
>
<
Td
>
{
item
.
itemSku
}
</
Td
>
<
Td
>
{
item
.
itemSku
}
</
Td
>
</
t
r
>
</
T
r
>
)
)
});
});
}
}
...
@@ -37,19 +37,19 @@ const OrderShowDetails = (props: any) => {
...
@@ -37,19 +37,19 @@ const OrderShowDetails = (props: any) => {
return
(
return
(
items
?
items
?
<
div
className=
"table-div
"
>
<
Table
variant=
"striped"
colorScheme=
"messenger"
size=
"lg
"
>
<
T
able
variant=
"striped"
colorScheme=
"messenger"
size=
"lg"
>
<
T
head
>
<
T
body
>
<
T
r
className=
"table-header"
>
<
T
r
className=
"table-header"
>
<
T
h
fontSize=
"22px"
color=
"gray"
>
ID
</
Th
>
<
Th
fontSize=
"22px"
color=
"gray"
>
ID
</
Th
>
<
Th
fontSize=
"22px"
color=
"gray"
>
Price
</
Th
>
<
Th
fontSize=
"22px"
color=
"gray"
>
Price
</
Th
>
<
Th
fontSize=
"22px"
color=
"gray"
>
Quantity
</
Th
>
<
Th
fontSize=
"22px"
color=
"gray"
>
Quantity
</
Th
>
<
Th
fontSize=
"22px"
color=
"gray"
>
SKU
</
Th
>
<
Th
fontSize=
"22px"
color=
"gray"
>
SKU
</
Th
>
</
Tr
>
</
Tr
>
</
Thead
>
{
itemDetails
}
<
Tbody
>
</
Tbody
>
{
itemDetails
}
</
T
able
>
</
T
body
>
</
div
>
</
Table
>
:
:
<
div
className=
"Order without items"
>
<
div
className=
"Order without items"
>
This order didn't contain any items.
This order didn't contain any items.
...
...
src/index.css
View file @
ea447497
...
@@ -37,42 +37,51 @@ body {
...
@@ -37,42 +37,51 @@ body {
padding
:
200px
0
;
padding
:
200px
0
;
}
}
/* .svg-inline--fa {
display: inline-block;
font-size: 24px;
height: 1.7em;
overflow: visible;
vertical-align: -0.325em;
} */
/* header */
/* header */
.header
{
.header
{
/* border-bottom: 1.5px solid orange; */
border-top
:
1.5px
solid
rgba
(
80
,
76
,
69
,
0.603
);
background-color
:
rgba
(
216
,
130
,
32
,
0.404
);
background-color
:
rgba
(
216
,
130
,
32
,
0.404
);
height
:
60px
;
}
}
.left-nav
{
.left-nav
{
padding
:
10px
0px
0px
50px
;
padding
:
0
0
0
40px
;
/* background-color: blueviolet; */
}
}
.right-nav
{
.right-nav
{
padding
:
30px
120px
0px
0px
;
padding
:
30px
70px
0px
0px
;
/* background-color: rgb(109, 109, 204); */
align-items
:
center
;
align-content
:
center
;
}
}
.right-nav
B
utton
{
.right-nav
b
utton
{
background-color
:
rgb
(
235
,
221
,
178
)
;
background-color
:
transparent
;
margin-right
:
15px
;
margin-right
:
15px
;
margin-top
:
4px
;
margin-top
:
4px
;
}
}
.right-nav
span
{
margin-left
:
10px
;
margin-right
:
25px
;
font-weight
:
600
;
}
.chakra-stack.right-nav.css-193rmy8
{
margin-bottom
:
50%
;
}
.nav-link
{
.nav-link
{
margin-right
:
15px
;
margin-right
:
15px
;
margin-left
:
15px
;
}
}
...
@@ -84,9 +93,6 @@ body {
...
@@ -84,9 +93,6 @@ body {
flex
:
1
0
auto
;
flex
:
1
0
auto
;
}
}
.body-div
{
padding-top
:
50px
;
}
.search-div
{
.search-div
{
...
@@ -126,8 +132,8 @@ input[type=text]:focus {
...
@@ -126,8 +132,8 @@ input[type=text]:focus {
outline
:
none
;
outline
:
none
;
}
}
.
table
-div
{
.
body-content
-div
{
padding
:
12
0
px
;
padding
:
12
4
px
;
padding-top
:
20px
;
padding-top
:
20px
;
}
}
...
@@ -140,15 +146,16 @@ input[type=text]:focus {
...
@@ -140,15 +146,16 @@ input[type=text]:focus {
}
}
.show-div
{
.show-div
{
padding
:
80px
1
5
0px
;
padding
:
80px
1
0
0px
;
}
}
.show-table
{
.show-table
{
border
:
1px
solid
rgb
(
110
,
106
,
106
);
border
:
1px
solid
rgb
(
110
,
106
,
106
);
/* padding: 0 10px 15px 10px; */
padding
:
0
10px
15px
10px
;
border-radius
:
2px
;
border-radius
:
2px
;
box-shadow
:
0
4px
8px
0
rgba
(
0
,
0
,
0
,
0.2
),
0
6px
20px
0
rgba
(
0
,
0
,
0
,
0.19
);
box-shadow
:
0
4px
8px
0
rgba
(
0
,
0
,
0
,
0.2
),
0
6px
20px
0
rgba
(
0
,
0
,
0
,
0.19
);
}
}
.table-header
{
.table-header
{
...
@@ -167,7 +174,7 @@ input[type=text]:focus {
...
@@ -167,7 +174,7 @@ input[type=text]:focus {
.footer
{
.footer
{
padding
:
5px
0
;
padding
:
5px
0
;
/* border-top: 1.5px solid orange; */
border-bottom
:
1.5px
solid
rgba
(
80
,
76
,
69
,
0.603
);
background-color
:
rgba
(
216
,
130
,
32
,
0.404
);
background-color
:
rgba
(
216
,
130
,
32
,
0.404
);
flex-shrink
:
0
;
flex-shrink
:
0
;
font-size
:
12px
;
font-size
:
12px
;
...
...
src/pages/OrderIndexPage.tsx
View file @
ea447497
...
@@ -19,11 +19,12 @@ const OrderIndexPage = () => {
...
@@ -19,11 +19,12 @@ const OrderIndexPage = () => {
const
[
orderDetailsArr
,
setOrderDetailsArr
]
=
useState
<
any
>
([])
const
[
orderDetailsArr
,
setOrderDetailsArr
]
=
useState
<
any
>
([])
const
orderDetailsArrCreator
=
(
orders
:
Order
[])
=>
{
const
orderDetailsArrCreator
=
(
orders
:
Order
[])
=>
{
return
orders
.
map
((
order
:
Order
,
idx
:
any
)
=>
{
return
orders
.
map
((
order
:
Order
,
idx
:
any
)
=>
{
return
<
Tr
key=
{
idx
}
><
OrderDetails
return
<
Tr
key=
{
idx
}
>
date=
{
new
Date
(
order
.
orderCreatedAt
).
toLocaleDateString
()
}
<
OrderDetails
orderNumber=
{
order
.
id
}
date=
{
new
Date
(
order
.
orderCreatedAt
).
toLocaleDateString
()
}
status=
{
order
.
orderStatus
}
orderNumber=
{
order
.
id
}
/></
Tr
>
status=
{
order
.
orderStatus
}
/>
</
Tr
>
})
})
}
}
...
@@ -56,35 +57,33 @@ const OrderIndexPage = () => {
...
@@ -56,35 +57,33 @@ const OrderIndexPage = () => {
}
}
return
(
return
(
<
div
className=
"body-div"
>
<
div
className=
"body-content-div"
>
<
div
className=
"table-div"
>
<
div
className=
"search-div"
>
<
div
className=
"search-div"
>
<
input
<
input
type=
"text"
type=
"text"
placeholder=
"Search Order Number"
placeholder=
"Search Order Number"
value=
{
searchInput
}
value=
{
searchInput
}
onChange=
{
handleChange
}
onChange=
{
handleChange
}
onKeyDown=
{
handleChange
}
onKeyDown=
{
handleChange
}
className=
"searchbar"
className=
"searchbar"
>
>
</
input
>
</
input
>
</
div
>
</
div
>
<
br
/>
<
br
/>
<
div
className=
"index-table"
>
<
div
className=
"index-table"
>
<
Table
variant=
"striped"
colorScheme=
"messenger"
size=
"sm"
>
<
Table
variant=
"striped"
colorScheme=
"messenger"
size=
"sm"
>
<
Thead
>
<
Thead
>
<
Tr
className=
"table-header"
>
<
Tr
className=
"table-header"
>
<
Th
fontSize=
"26px"
color=
"gray"
>
Order number
</
Th
>
<
Th
fontSize=
"26px"
color=
"gray"
>
Order number
</
Th
>
<
Th
fontSize=
"26px"
color=
"gray"
>
Order Date
</
Th
>
<
Th
fontSize=
"26px"
color=
"gray"
>
Order Date
</
Th
>
<
Th
fontSize=
"26px"
color=
"gray"
>
Order Status
</
Th
>
<
Th
fontSize=
"26px"
color=
"gray"
>
Order Status
</
Th
>
</
Tr
>
</
Tr
>
</
Thead
>
</
Thead
>
<
Tbody
>
<
Tbody
>
{
orderDetailsArr
}
{
orderDetailsArr
}
</
Tbody
>
</
Tbody
>
</
Table
>
</
Table
>
</
div
>
</
div
>
</
div
>
</
div
>
</
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