Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
final-exam
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nawasan Wisitsingkhon
final-exam
Commits
b8bb5f4c
Commit
b8bb5f4c
authored
Oct 03, 2023
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update product display in admin
parent
95bc0080
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
59 deletions
+61
-59
stock.js
src/pages/admin/stock.js
+61
-59
No files found.
src/pages/admin/stock.js
View file @
b8bb5f4c
...
@@ -57,65 +57,67 @@ export default function Stock() {
...
@@ -57,65 +57,67 @@ export default function Stock() {
เพิ่มสินค้า
เพิ่มสินค้า
<
/Button
>
<
/Button
>
<
/Box
>
<
/Box
>
{
productsFilter
.
map
((
product
,
idx
)
=>
(
<
div
className
=
"mx-auto text-left grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 2xl:grid-cols-4 max-w-[1520px]"
>
<
Card
{
productsFilter
.
map
((
product
,
idx
)
=>
(
key
=
{
idx
}
<
Card
sx
=
{{
key
=
{
idx
}
m
:
1
,
sx
=
{{
px
:
1
,
m
:
1
,
width
:
300
,
px
:
1
,
height
:
500
,
width
:
300
,
display
:
"inline-block"
,
height
:
500
,
}}
display
:
"inline-block"
,
>
}}
<
Box
sx
=
{{
px
:
1
}}
>
>
<
h5
className
=
"h-[40px] overflow-y-hidden"
>
{
product
.
name
}
<
/h5
>
<
Box
sx
=
{{
px
:
1
}}
>
<
/Box
>
<
h5
className
=
"h-[40px] overflow-y-hidden"
>
{
product
.
name
}
<
/h5
>
<
CardMedia
<
/Box
>
className
=
"rounded"
<
CardMedia
component
=
{
"img"
}
className
=
"rounded"
height
=
{
150
}
component
=
{
"img"
}
image
=
{
product
.
image
.
length
?
product
.
image
:
"/empty.jpg"
}
height
=
{
150
}
/
>
image
=
{
product
.
image
.
length
?
product
.
image
:
"/empty.jpg"
}
<
CardContent
sx
=
{{
px
:
1
}}
>
/
>
<
Typography
<
CardContent
sx
=
{{
px
:
1
}}
>
sx
=
{{
height
:
70
,
overflowY
:
"scroll"
}}
<
Typography
variant
=
"body2"
sx
=
{{
height
:
70
,
overflowY
:
"scroll"
}}
color
=
{
"text.secondary"
}
variant
=
"body2"
>
color
=
{
"text.secondary"
}
{
product
.
detail
}
>
<
/Typography
>
{
product
.
detail
}
<
Table
sx
=
{{
m
:
0
,
p
:
0
}}
>
<
/Typography
>
<
TableBody
>
<
Table
sx
=
{{
m
:
0
,
p
:
0
}}
>
<
TableRow
sx
=
{{
m
:
0
,
p
:
0
}}
>
<
TableBody
>
<
TableCell
sx
=
{{
m
:
0
,
p
:
0
,
textAlign
:
"center "
}}
>
<
TableRow
sx
=
{{
m
:
0
,
p
:
0
}}
>
{
Number
(
product
.
price
).
toLocaleString
()
+
" บาท"
}
<
TableCell
sx
=
{{
m
:
0
,
p
:
0
,
textAlign
:
"center "
}}
>
<
/TableCell
>
{
Number
(
product
.
price
).
toLocaleString
()
+
" บาท"
}
<
TableCell
>
{
`ส่วนลด
${
product
.
discount
}
%`
}
<
/TableCell
>
<
/TableCell
>
<
/TableRow
>
<
TableCell
>
{
`ส่วนลด
${
product
.
discount
}
%`
}
<
/TableCell
>
<
TableRow
>
<
/TableRow
>
<
TableCell
>
เข้าชม
{
product
.
watch_count
}
ครั้ง
<
/TableCell
>
<
TableRow
>
<
TableCell
>
คงเหลือ
{
product
.
stock
}
ชิ้น
<
/TableCell
>
<
TableCell
>
เข้าชม
{
product
.
watch_count
}
ครั้ง
<
/TableCell
>
<
/TableRow
>
<
TableCell
>
คงเหลือ
{
product
.
stock
}
ชิ้น
<
/TableCell
>
<
/TableBody
>
<
/TableRow
>
<
/Table
>
<
/TableBody
>
<
/CardContent
>
<
/Table
>
<
CardActions
disableSpacing
sx
=
{{
justifyContent
:
"end"
}}
>
<
/CardContent
>
<
Button
<
CardActions
disableSpacing
sx
=
{{
justifyContent
:
"end"
}}
>
color
=
"warning"
<
Button
onClick
=
{()
=>
setUpdateState
({
open
:
true
,
data
:
product
})}
color
=
"warning"
>
onClick
=
{()
=>
setUpdateState
({
open
:
true
,
data
:
product
})}
<
Edit
/>
แก้ไข
>
<
/Button
>
<
Edit
/>
แก้ไข
<
Button
<
/Button
>
color
=
"error"
<
Button
onClick
=
{()
=>
setDeleteState
({
open
:
true
,
id
:
product
.
id
})}
color
=
"error"
>
onClick
=
{()
=>
setDeleteState
({
open
:
true
,
id
:
product
.
id
})}
<
Delete
/>
ลบ
>
<
/Button
>
<
Delete
/>
ลบ
<
/CardActions
>
<
/Button
>
<
/Card
>
<
/CardActions
>
))}
<
/Card
>
))}
<
/div
>
<
AddProduct
open
=
{
modal
}
handleClose
=
{()
=>
setModal
(
false
)}
/
>
<
AddProduct
open
=
{
modal
}
handleClose
=
{()
=>
setModal
(
false
)}
/
>
<
/Box
>
<
/Box
>
{
updateState
.
open
&&
(
{
updateState
.
open
&&
(
...
...
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