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
47097b4e
Commit
47097b4e
authored
Oct 26, 2023
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix & updates: responsive for large screen;
parent
88a92b3e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
80 additions
and
79 deletions
+80
-79
AdminNavbar.js
src/components/AdminNavbar.js
+1
-1
Footer.js
src/components/Footer.js
+1
-1
Navbar.js
src/components/Navbar.js
+2
-2
ProductCard.js
src/components/ProductCard.js
+1
-2
member.js
src/pages/admin/member.js
+72
-70
stock.js
src/pages/admin/stock.js
+2
-2
index.js
src/pages/index.js
+1
-1
No files found.
src/components/AdminNavbar.js
View file @
47097b4e
...
@@ -246,7 +246,7 @@ function AdminNavbar(props) {
...
@@ -246,7 +246,7 @@ function AdminNavbar(props) {
return
(
return
(
<>
<>
<
AppBar
position
=
"fixed"
style
=
{{
backgroundColor
:
"black"
}}
>
<
AppBar
position
=
"fixed"
style
=
{{
backgroundColor
:
"black"
}}
>
<
Toolbar
>
<
Toolbar
className
=
"max-w-[1520px] 2xl:mx-auto 2xl:w-full box-border"
>
<
Typography
<
Typography
variant
=
"h6"
variant
=
"h6"
noWrap
noWrap
...
...
src/components/Footer.js
View file @
47097b4e
...
@@ -5,7 +5,7 @@ import React from "react";
...
@@ -5,7 +5,7 @@ import React from "react";
export
default
function
Footer
()
{
export
default
function
Footer
()
{
return
(
return
(
<
Box
<
Box
className
=
"md:flex text-center justify-end items-center"
className
=
"md:flex text-center justify-end items-center
max-w-[1520px] mx-auto
"
sx
=
{{
sx
=
{{
p
:
3
,
p
:
3
,
}}
}}
...
...
src/components/Navbar.js
View file @
47097b4e
...
@@ -307,11 +307,11 @@ function Navbar(props) {
...
@@ -307,11 +307,11 @@ function Navbar(props) {
return
(
return
(
<>
<>
<
AppBar
<
AppBar
className
=
"shadow-sm bg-white/90"
className
=
"shadow-sm bg-white/90
px-0
"
color
=
"inherit"
color
=
"inherit"
position
=
"fixed"
position
=
"fixed"
>
>
<
Toolbar
>
<
Toolbar
className
=
"max-w-[1520px] 2xl:mx-auto 2xl:w-full box-border"
>
<
Typography
<
Typography
variant
=
"h6"
variant
=
"h6"
noWrap
noWrap
...
...
src/components/ProductCard.js
View file @
47097b4e
...
@@ -29,11 +29,10 @@ export default function ProductCard({
...
@@ -29,11 +29,10 @@ export default function ProductCard({
*/
*/
return
(
return
(
<
div
<
div
className
=
"p-1 my-3 w-[300px] mx-auto inline-block bg-white rounded hover:shadow duration-300"
className
=
"p-1 my-3 w-[300px]
sm:w-[270px] xl:w-[320px]
mx-auto inline-block bg-white rounded hover:shadow duration-300"
sx
=
{{
sx
=
{{
m
:
1
,
m
:
1
,
px
:
1
,
px
:
1
,
width
:
300
,
// height: 500,
// height: 500,
display
:
"inline-block"
,
display
:
"inline-block"
,
}}
}}
...
...
src/pages/admin/member.js
View file @
47097b4e
...
@@ -7,8 +7,6 @@ import {
...
@@ -7,8 +7,6 @@ import {
Box
,
Box
,
Button
,
Button
,
FormControl
,
FormControl
,
FormLabel
,
InputLabel
,
MenuItem
,
MenuItem
,
Paper
,
Paper
,
Select
,
Select
,
...
@@ -89,75 +87,79 @@ export default function Member() {
...
@@ -89,75 +87,79 @@ export default function Member() {
{
message
.
message
}
{
message
.
message
}
<
/Alert
>
<
/Alert
>
<
/Snackbar
>
<
/Snackbar
>
<
Box
sx
=
{{
m
:
1
,
textAlign
:
"right"
}}
>
<
Box
sx
=
{{
maxWidth
:
1520
,
mx
:
"auto"
}}
>
<
FormControl
>
<
Box
sx
=
{{
m
:
1
,
textAlign
:
"right"
}}
>
<
Select
<
FormControl
>
variant
=
"standard"
<
Select
value
=
{
filterAdmin
}
variant
=
"standard"
onChange
=
{(
e
)
=>
setFilterAdmin
(
Number
(
e
.
target
.
value
))}
value
=
{
filterAdmin
}
>
onChange
=
{(
e
)
=>
setFilterAdmin
(
Number
(
e
.
target
.
value
))}
<
MenuItem
value
=
{
-
1
}
>
ทั้งหมด
<
/MenuItem
>
>
<
MenuItem
value
=
{
0
}
>
admin
<
/MenuItem
>
<
MenuItem
value
=
{
-
1
}
>
ทั้งหมด
<
/MenuItem
>
<
MenuItem
value
=
{
1
}
>
ผู้ใช้
<
/MenuItem
>
<
MenuItem
value
=
{
0
}
>
admin
<
/MenuItem
>
<
/Select
>
<
MenuItem
value
=
{
1
}
>
ผู้ใช้
<
/MenuItem
>
<
/FormControl
>
<
/Select
>
<
/Box
>
<
/FormControl
>
<
Paper
sx
=
{{
p
:
2
,
overflowX
:
"scroll"
}}
>
<
/Box
>
<
Table
>
<
Paper
sx
=
{{
p
:
2
,
overflowX
:
"scroll"
}}
>
<
TableHead
>
<
Table
>
<
TableRow
>
<
TableHead
>
{[
<
TableRow
>
"id"
,
{[
"รูป"
,
"id"
,
"ชื่อ"
,
"รูป"
,
"username"
,
"ชื่อ"
,
"เบอร์โทร"
,
"username"
,
"อีเมล"
,
"เบอร์โทร"
,
"rank"
,
"อีเมล"
,
"ลบ"
,
"rank"
,
].
map
((
label
,
idx
)
=>
(
"ลบ"
,
<
TableCell
sx
=
{{
textAlign
:
"center"
}}
key
=
{
idx
}
>
].
map
((
label
,
idx
)
=>
(
{
label
}
<
TableCell
sx
=
{{
textAlign
:
"center"
}}
key
=
{
idx
}
>
<
/TableCell
>
{
label
}
))}
<
/TableCell
>
<
/TableRow
>
))}
<
/TableHead
>
<
TableBody
>
{
userAllFilter
.
map
((
user
,
idx
)
=>
(
<
TableRow
key
=
{
idx
}
>
<
TableCell
>
{
user
.
id
}
<
/TableCell
>
<
TableCell
>
<
img
className
=
"rounded-lg object-cover"
width
=
{
70
}
height
=
{
70
}
src
=
{
user
?.
photo
?.
length
?
user
.
photo
:
"/empty.jpg"
}
alt
=
"profile"
/>
<
/TableCell
>
<
TableCell
>
{
user
.
name
}
<
/TableCell
>
<
TableCell
>
@{
user
.
username
}
<
/TableCell
>
<
TableCell
>
{
user
.
phone
}
<
/TableCell
>
<
TableCell
>
{
user
.
email
}
<
/TableCell
>
<
TableCell
sx
=
{{
textAlign
:
"center"
}}
>
<
Switch
checked
=
{
!!
user
.
rank
}
onChange
=
{()
=>
changeRank
(
user
.
id
,
!
user
.
rank
)}
/
>
<
/TableCell
>
<
TableCell
sx
=
{{
textAlign
:
"center"
}}
>
<
Button
onClick
=
{()
=>
setDeleteState
({
open
:
true
,
id
:
user
.
id
})}
color
=
"error"
>
ลบ
<
/Button
>
<
/TableCell
>
<
/TableRow
>
<
/TableRow
>
))}
<
/TableHead
>
<
/TableBody
>
<
TableBody
>
<
/Table
>
{
userAllFilter
.
map
((
user
,
idx
)
=>
(
<
/Paper
>
<
TableRow
key
=
{
idx
}
>
<
TableCell
>
{
user
.
id
}
<
/TableCell
>
<
TableCell
>
<
img
className
=
"rounded-lg object-cover"
width
=
{
70
}
height
=
{
70
}
src
=
{
user
?.
photo
?.
length
?
user
.
photo
:
"/empty.jpg"
}
alt
=
"profile"
/>
<
/TableCell
>
<
TableCell
>
{
user
.
name
}
<
/TableCell
>
<
TableCell
>
@{
user
.
username
}
<
/TableCell
>
<
TableCell
>
{
user
.
phone
}
<
/TableCell
>
<
TableCell
>
{
user
.
email
}
<
/TableCell
>
<
TableCell
sx
=
{{
textAlign
:
"center"
}}
>
<
Switch
checked
=
{
!!
user
.
rank
}
onChange
=
{()
=>
changeRank
(
user
.
id
,
!
user
.
rank
)}
/
>
<
/TableCell
>
<
TableCell
sx
=
{{
textAlign
:
"center"
}}
>
<
Button
onClick
=
{()
=>
setDeleteState
({
open
:
true
,
id
:
user
.
id
})
}
color
=
"error"
>
ลบ
<
/Button
>
<
/TableCell
>
<
/TableRow
>
))}
<
/TableBody
>
<
/Table
>
<
/Paper
>
<
/Box
>
{
deleteState
.
open
&&
(
{
deleteState
.
open
&&
(
<
DeleteMember
<
DeleteMember
open
=
{
deleteState
.
open
}
open
=
{
deleteState
.
open
}
...
...
src/pages/admin/stock.js
View file @
47097b4e
...
@@ -54,7 +54,7 @@ export default function Stock() {
...
@@ -54,7 +54,7 @@ export default function Stock() {
if
(
router
.
query
?.
cat
)
{
if
(
router
.
query
?.
cat
)
{
setCategory
(
router
.
query
.
cat
);
setCategory
(
router
.
query
.
cat
);
}
else
{
}
else
{
setCategory
(
''
);
setCategory
(
""
);
}
}
},
[
router
]);
},
[
router
]);
...
@@ -64,7 +64,7 @@ export default function Stock() {
...
@@ -64,7 +64,7 @@ export default function Stock() {
<
title
>
รายการสินค้า
|
admin
<
/title
>
<
title
>
รายการสินค้า
|
admin
<
/title
>
<
/Head
>
<
/Head
>
<
Box
>
<
Box
>
<
Box
sx
=
{{
mb
:
2
,
textAlign
:
"right"
}}
>
<
Box
sx
=
{{
m
axWidth
:
1520
,
mx
:
"auto"
,
m
b
:
2
,
textAlign
:
"right"
}}
>
<
Button
onClick
=
{()
=>
setModal
(
!
modal
)}
>
<
Button
onClick
=
{()
=>
setModal
(
!
modal
)}
>
<
AddShoppingCart
/>
<
AddShoppingCart
/>
เพิ่มสินค้า
เพิ่มสินค้า
...
...
src/pages/index.js
View file @
47097b4e
...
@@ -242,7 +242,7 @@ export default function Home() {
...
@@ -242,7 +242,7 @@ export default function Home() {
))}
))}
<
/div
>
<
/div
>
)
:
(
)
:
(
<
Paper
className
=
"shadow-none"
sx
=
{{
p
:
2
,
textAlign
:
"center"
}}
>
<
Paper
className
=
"
max-w-[1520px] mx-auto
shadow-none"
sx
=
{{
p
:
2
,
textAlign
:
"center"
}}
>
{
algorithm
.
length
?
"ไม่พบรายการ"
:
<
CircularProgress
/>
}
{
algorithm
.
length
?
"ไม่พบรายการ"
:
<
CircularProgress
/>
}
<
/Paper
>
<
/Paper
>
)}
)}
...
...
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