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
19c283bf
Commit
19c283bf
authored
Oct 02, 2023
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search on AdminNavbar
parent
d93bc232
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
AdminNavbar.js
src/components/AdminNavbar.js
+18
-6
No files found.
src/components/AdminNavbar.js
View file @
19c283bf
...
@@ -9,21 +9,18 @@ import Typography from "@mui/material/Typography";
...
@@ -9,21 +9,18 @@ import Typography from "@mui/material/Typography";
import
InputBase
from
"@mui/material/InputBase"
;
import
InputBase
from
"@mui/material/InputBase"
;
import
Badge
from
"@mui/material/Badge"
;
import
Badge
from
"@mui/material/Badge"
;
import
MenuItem
from
"@mui/material/MenuItem"
;
import
MenuItem
from
"@mui/material/MenuItem"
;
import
{
InsertChart
}
from
"@mui/icons-material"
;
import
Menu
from
"@mui/material/Menu"
;
import
Menu
from
"@mui/material/Menu"
;
import
MenuIcon
from
"@mui/icons-material/Menu"
;
import
MenuIcon
from
"@mui/icons-material/Menu"
;
import
SearchIcon
from
"@mui/icons-material/Search"
;
import
SearchIcon
from
"@mui/icons-material/Search"
;
import
AccountCircle
from
"@mui/icons-material/AccountCircle"
;
import
ShoppingCart
from
"@mui/icons-material/ShoppingCart"
;
import
{
UserContext
}
from
"@/pages/_app"
;
import
{
UserContext
}
from
"@/pages/_app"
;
import
Link
from
"next/link"
;
import
Link
from
"next/link"
;
import
{
Favorite
}
from
"@mui/icons-material"
;
import
{
Logout
,
SupervisedUserCircle
}
from
"@mui/icons-material"
;
import
{
InsertChart
}
from
"@mui/icons-material"
;
import
{
ProductionQuantityLimits
}
from
"@mui/icons-material"
;
import
{
ProductionQuantityLimits
}
from
"@mui/icons-material"
;
import
{
Inventory
}
from
"@mui/icons-material"
;
import
{
Inventory
}
from
"@mui/icons-material"
;
import
{
Category
}
from
"@mui/icons-material"
;
import
{
Category
}
from
"@mui/icons-material"
;
import
{
PeopleAlt
}
from
"@mui/icons-material"
;
import
{
PeopleAlt
}
from
"@mui/icons-material"
;
import
{
MeetingRoom
}
from
"@mui/icons-material"
;
import
{
MeetingRoom
}
from
"@mui/icons-material"
;
import
{
useRouter
}
from
"next/router"
;
const
Search
=
styled
(
"div"
)(({
theme
})
=>
({
const
Search
=
styled
(
"div"
)(({
theme
})
=>
({
position
:
"relative"
,
position
:
"relative"
,
...
@@ -67,10 +64,18 @@ const StyledInputBase = styled(InputBase)(({ theme }) => ({
...
@@ -67,10 +64,18 @@ const StyledInputBase = styled(InputBase)(({ theme }) => ({
function
AdminNavbar
(
props
)
{
function
AdminNavbar
(
props
)
{
const
user
=
useContext
(
UserContext
);
const
user
=
useContext
(
UserContext
);
const
router
=
useRouter
();
const
[
search
,
setSearch
]
=
React
.
useState
(
router
.
query
?.
q
??
""
);
const
{
window
}
=
props
;
const
{
window
}
=
props
;
const
[
anchorEl
,
setAnchorEl
]
=
React
.
useState
(
null
);
const
[
anchorEl
,
setAnchorEl
]
=
React
.
useState
(
null
);
const
[
mobileMoreAnchorEl
,
setMobileMoreAnchorEl
]
=
React
.
useState
(
null
);
const
[
mobileMoreAnchorEl
,
setMobileMoreAnchorEl
]
=
React
.
useState
(
null
);
const
[
mobileOpen
,
setMobileOpen
]
=
React
.
useState
(
false
);
const
[
mobileOpen
,
setMobileOpen
]
=
React
.
useState
(
false
);
React
.
useEffect
(()
=>
{
router
.
push
({
pathname
:
router
.
pathname
,
query
:
{
q
:
search
}})
},
[
search
])
const
handleDrawerToggle
=
()
=>
{
const
handleDrawerToggle
=
()
=>
{
setMobileOpen
(
!
mobileOpen
);
setMobileOpen
(
!
mobileOpen
);
};
};
...
@@ -238,12 +243,19 @@ function AdminNavbar(props) {
...
@@ -238,12 +243,19 @@ function AdminNavbar(props) {
<
StyledInputBase
<
StyledInputBase
placeholder
=
"Search…"
placeholder
=
"Search…"
inputProps
=
{{
"aria-label"
:
"search"
}}
inputProps
=
{{
"aria-label"
:
"search"
}}
value
=
{
search
}
onChange
=
{(
e
)
=>
setSearch
(
e
.
target
.
value
)}
/
>
/
>
<
/Search
>
<
/Search
>
<
Box
sx
=
{{
flexGrow
:
1
}}
/
>
<
Box
sx
=
{{
flexGrow
:
1
}}
/
>
<
Box
sx
=
{{
display
:
{
xs
:
"none"
,
md
:
"flex"
}
}}
>
<
Box
sx
=
{{
display
:
{
xs
:
"none"
,
md
:
"flex"
}
}}
>
{
MenuList
.
map
((
menu
,
idx
)
=>
(
{
MenuList
.
map
((
menu
,
idx
)
=>
(
<
Link
title
=
{
menu
.
label
}
className
=
"text-white"
key
=
{
idx
}
href
=
{
menu
.
link
}
>
<
Link
title
=
{
menu
.
label
}
className
=
"text-white"
key
=
{
idx
}
href
=
{
menu
.
link
}
>
<
span
>
{
menu
.
element
}
<
/span
>
<
span
>
{
menu
.
element
}
<
/span
>
<
/Link
>
<
/Link
>
))}
))}
...
...
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