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
e9153812
Commit
e9153812
authored
Sep 29, 2023
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update menu navbar
parent
e306a483
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
72 deletions
+41
-72
Navbar.js
src/components/Navbar.js
+41
-72
No files found.
src/components/Navbar.js
View file @
e9153812
...
@@ -25,6 +25,7 @@ import CssBaseline from "@mui/material/CssBaseline";
...
@@ -25,6 +25,7 @@ import CssBaseline from "@mui/material/CssBaseline";
import
Drawer
from
"@mui/material/Drawer"
;
import
Drawer
from
"@mui/material/Drawer"
;
import
InboxIcon
from
"@mui/icons-material/MoveToInbox"
;
import
InboxIcon
from
"@mui/icons-material/MoveToInbox"
;
import
ListItemText
from
"@mui/material/ListItemText"
;
import
ListItemText
from
"@mui/material/ListItemText"
;
import
ShoppingCart
from
"@mui/icons-material/ShoppingCart"
;
const
Search
=
styled
(
"div"
)(({
theme
})
=>
({
const
Search
=
styled
(
"div"
)(({
theme
})
=>
({
position
:
"relative"
,
position
:
"relative"
,
...
@@ -82,19 +83,7 @@ const drawer = (
...
@@ -82,19 +83,7 @@ const drawer = (
<
/ListItem
>
<
/ListItem
>
))}
))}
<
/List
>
<
/List
>
<
Divider
/>
{
/* <Divider /> */
}
<
List
>
{[
"All mail"
,
"Trash"
,
"Spam"
].
map
((
text
,
index
)
=>
(
<
ListItem
key
=
{
text
}
disablePadding
>
<
ListItemButton
>
<
ListItemIcon
>
{
index
%
2
===
0
?
<
InboxIcon
/>
:
<
MailIcon
/>
}
<
/ListItemIcon
>
<
ListItemText
primary
=
{
text
}
/
>
<
/ListItemButton
>
<
/ListItem
>
))}
<
/List
>
<
/div
>
<
/div
>
);
);
...
@@ -153,6 +142,38 @@ function Navbar(props) {
...
@@ -153,6 +142,38 @@ function Navbar(props) {
<
/Menu
>
<
/Menu
>
);
);
const
MenuList
=
[
{
id
:
0
,
label
:
"ตระกร้า"
,
link
:
'/cart'
,
element
:
(
<
IconButton
size
=
"large"
aria
-
label
=
"show 4 new mails"
color
=
"inherit"
>
<
Badge
badgeContent
=
{
4
}
color
=
"error"
>
<
ShoppingCart
/>
<
/Badge
>
<
/IconButton
>
),
},
{
id
:
1
,
label
:
"โปรไฟล์"
,
link
:
"/profile"
,
element
:
(
<
IconButton
size
=
"large"
edge
=
"end"
aria
-
label
=
"account of current user"
aria
-
controls
=
{
menuId
}
aria
-
haspopup
=
"true"
color
=
"inherit"
>
<
AccountCircle
/>
<
/IconButton
>
),
},
];
const
mobileMenuId
=
"primary-search-account-menu-mobile"
;
const
mobileMenuId
=
"primary-search-account-menu-mobile"
;
const
renderMobileMenu
=
(
const
renderMobileMenu
=
(
<
Menu
<
Menu
...
@@ -170,38 +191,14 @@ function Navbar(props) {
...
@@ -170,38 +191,14 @@ function Navbar(props) {
open
=
{
isMobileMenuOpen
}
open
=
{
isMobileMenuOpen
}
onClose
=
{
handleMobileMenuClose
}
onClose
=
{
handleMobileMenuClose
}
>
>
{
MenuList
.
map
((
menu
)
=>
(
<>
<
MenuItem
>
<
MenuItem
>
<
IconButton
size
=
"large"
aria
-
label
=
"show 4 new mails"
color
=
"inherit"
>
{
menu
.
element
}
<
Badge
badgeContent
=
{
4
}
color
=
"error"
>
<
p
>
{
menu
.
label
}
<
/p
>
<
MailIcon
/>
<
/Badge
>
<
/IconButton
>
<
p
>
Messages
<
/p
>
<
/MenuItem
>
<
MenuItem
>
<
IconButton
size
=
"large"
aria
-
label
=
"show 17 new notifications"
color
=
"inherit"
>
<
Badge
badgeContent
=
{
17
}
color
=
"error"
>
<
NotificationsIcon
/>
<
/Badge
>
<
/IconButton
>
<
p
>
Notifications
<
/p
>
<
/MenuItem
>
<
MenuItem
onClick
=
{
handleProfileMenuOpen
}
>
<
IconButton
size
=
"large"
aria
-
label
=
"account of current user"
aria
-
controls
=
"primary-search-account-menu"
aria
-
haspopup
=
"true"
color
=
"inherit"
>
<
AccountCircle
/>
<
/IconButton
>
<
p
>
Profile
<
/p
>
<
/MenuItem
>
<
/MenuItem
>
<
/
>
))}
<
/Menu
>
<
/Menu
>
);
);
...
@@ -243,35 +240,7 @@ function Navbar(props) {
...
@@ -243,35 +240,7 @@ function Navbar(props) {
<
/Search
>
<
/Search
>
<
Box
sx
=
{{
flexGrow
:
1
}}
/
>
<
Box
sx
=
{{
flexGrow
:
1
}}
/
>
<
Box
sx
=
{{
display
:
{
xs
:
"none"
,
md
:
"flex"
}
}}
>
<
Box
sx
=
{{
display
:
{
xs
:
"none"
,
md
:
"flex"
}
}}
>
<
IconButton
{
MenuList
.
map
((
menu
)
=>
menu
.
element
)}
size
=
"large"
aria
-
label
=
"show 4 new mails"
color
=
"inherit"
>
<
Badge
badgeContent
=
{
4
}
color
=
"error"
>
<
MailIcon
/>
<
/Badge
>
<
/IconButton
>
<
IconButton
size
=
"large"
aria
-
label
=
"show 17 new notifications"
color
=
"inherit"
>
<
Badge
badgeContent
=
{
17
}
color
=
"error"
>
<
NotificationsIcon
/>
<
/Badge
>
<
/IconButton
>
<
IconButton
size
=
"large"
edge
=
"end"
aria
-
label
=
"account of current user"
aria
-
controls
=
{
menuId
}
aria
-
haspopup
=
"true"
onClick
=
{
handleProfileMenuOpen
}
color
=
"inherit"
>
<
AccountCircle
/>
<
/IconButton
>
<
/Box
>
<
/Box
>
<
Box
sx
=
{{
display
:
{
xs
:
"flex"
,
md
:
"none"
}
}}
>
<
Box
sx
=
{{
display
:
{
xs
:
"flex"
,
md
:
"none"
}
}}
>
<
IconButton
<
IconButton
...
...
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