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
2d4c59fc
Commit
2d4c59fc
authored
Oct 07, 2023
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: admin page on mobile;
parent
31785e10
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
72 deletions
+66
-72
category.js
src/pages/admin/category.js
+64
-70
member.js
src/pages/admin/member.js
+1
-1
stock.js
src/pages/admin/stock.js
+1
-1
No files found.
src/pages/admin/category.js
View file @
2d4c59fc
...
...
@@ -45,76 +45,70 @@ export default function AdminCategory() {
<
Head
>
<
title
>
จัดการหมวดหมู่
|
admin
<
/title
>
<
/Head
>
<
Box
>
<
Grid
container
>
<
Grid
item
lg
=
{
3
}
md
=
{
0
}
><
/Grid
>
<
Grid
item
lg
=
{
6
}
md
=
{
12
}
>
<
Box
sx
=
{{
mb
:
2
,
textAlign
:
"right"
}}
>
<
Button
onClick
=
{()
=>
setModal
(
true
)}
>
<
Add
/>
เพิ่มหมวดหมู่
<
/Button
>
<
/Box
>
<
Paper
sx
=
{{
p
:
2
,
overflowX
:
"scroll"
}}
>
<
div
>
<
Table
>
<
TableHead
>
<
TableRow
>
<
TableCell
>
id
<
/TableCell
>
<
TableCell
>
ชื่อ
<
/TableCell
>
<
TableCell
sx
=
{{
maxWidth
:
10
,
textAlign
:
"center"
}}
>
แก้ไข
<
/TableCell
>
<
TableCell
sx
=
{{
maxWidth
:
10
,
textAlign
:
"center"
}}
>
ลบ
<
/TableCell
>
<
/TableRow
>
<
/TableHead
>
<
TableBody
>
{
category
.
map
(
(
cate
,
idx
)
=>
(
!
router
.
query
?.
q
||
cate
.
id
===
Number
(
router
.
query
.
q
)
||
String
(
cate
.
name
)
.
toLocaleLowerCase
()
.
includes
(
String
(
router
.
query
.
q
).
toLocaleLowerCase
()
))
&&
(
<
TableRow
key
=
{
idx
}
>
<
TableCell
>
{
cate
.
id
}
<
/TableCell
>
<
TableCell
>
{
cate
.
name
}
<
/TableCell
>
<
TableCell
sx
=
{{
maxWidth
:
10
}}
>
<
Button
color
=
"warning"
onClick
=
{()
=>
setUpdateState
({
open
:
true
,
data
:
{
id
:
cate
.
id
,
name
:
cate
.
name
},
})
}
>
<
Edit
/>
<
/Button
>
<
/TableCell
>
<
TableCell
sx
=
{{
maxWidth
:
10
}}
>
<
Button
color
=
"error"
onClick
=
{()
=>
setDeleteState
({
open
:
true
,
id
:
cate
.
id
})
}
>
<
Delete
/>
<
/Button
>
<
/TableCell
>
<
/TableRow
>
)
)}
<
/TableBody
>
<
/Table
>
<
/div
>
<
/Paper
>
<
/Grid
>
<
Grid
item
lg
=
{
3
}
md
=
{
0
}
><
/Grid
>
<
/Grid
>
<
Box
sx
=
{{
maxWidth
:
800
,
mx
:
"auto"
}}
>
<
Box
sx
=
{{
mb
:
2
,
textAlign
:
"right"
}}
>
<
Button
onClick
=
{()
=>
setModal
(
true
)}
>
<
Add
/>
เพิ่มหมวดหมู่
<
/Button
>
<
/Box
>
<
Paper
sx
=
{{
p
:
2
,
overflowX
:
"scroll"
}}
>
<
div
>
<
Table
>
<
TableHead
>
<
TableRow
>
<
TableCell
>
id
<
/TableCell
>
<
TableCell
>
ชื่อ
<
/TableCell
>
<
TableCell
sx
=
{{
maxWidth
:
10
,
textAlign
:
"center"
}}
>
แก้ไข
<
/TableCell
>
<
TableCell
sx
=
{{
maxWidth
:
10
,
textAlign
:
"center"
}}
>
ลบ
<
/TableCell
>
<
/TableRow
>
<
/TableHead
>
<
TableBody
>
{
category
.
map
(
(
cate
,
idx
)
=>
(
!
router
.
query
?.
q
||
cate
.
id
===
Number
(
router
.
query
.
q
)
||
String
(
cate
.
name
)
.
toLocaleLowerCase
()
.
includes
(
String
(
router
.
query
.
q
).
toLocaleLowerCase
()
))
&&
(
<
TableRow
key
=
{
idx
}
>
<
TableCell
>
{
cate
.
id
}
<
/TableCell
>
<
TableCell
>
{
cate
.
name
}
<
/TableCell
>
<
TableCell
sx
=
{{
maxWidth
:
10
}}
>
<
Button
color
=
"warning"
onClick
=
{()
=>
setUpdateState
({
open
:
true
,
data
:
{
id
:
cate
.
id
,
name
:
cate
.
name
},
})
}
>
<
Edit
/>
<
/Button
>
<
/TableCell
>
<
TableCell
sx
=
{{
maxWidth
:
10
}}
>
<
Button
color
=
"error"
onClick
=
{()
=>
setDeleteState
({
open
:
true
,
id
:
cate
.
id
})
}
>
<
Delete
/>
<
/Button
>
<
/TableCell
>
<
/TableRow
>
)
)}
<
/TableBody
>
<
/Table
>
<
/div
>
<
/Paper
>
{
deleteState
.
open
&&
(
<
DeleteCategory
...
...
src/pages/admin/member.js
View file @
2d4c59fc
...
...
@@ -102,7 +102,7 @@ export default function Member() {
<
/Select
>
<
/FormControl
>
<
/Box
>
<
Paper
sx
=
{{
p
:
2
}}
>
<
Paper
sx
=
{{
p
:
2
,
overflowX
:
"scroll"
}}
>
<
Table
>
<
TableHead
>
<
TableRow
>
...
...
src/pages/admin/stock.js
View file @
2d4c59fc
...
...
@@ -71,7 +71,7 @@ export default function Stock() {
<
/Button
>
<
/Box
>
<
Box
className
=
"flex justify-start mb-3 px-10 max-w-[1520px] mx-auto"
>
<
Box
className
=
"flex justify-start mb-3
sm:
px-10 max-w-[1520px] mx-auto"
>
<
Box
sx
=
{{
display
:
"flex"
,
overflowX
:
"scroll"
,
maxWidth
:
"100vw"
}}
>
<
Button
variant
=
{
category
===
-
1
?
"contained"
:
"text"
}
...
...
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