|
|
|
|
|
|
|
|
import React, { useState, useMemo } from "react"; |
|
|
import React, { useState, useMemo } from "react"; |
|
|
import { SearchInput } from "./NavbarComponent.styled"; |
|
|
import { SearchInput } from "./NavbarComponent.styled"; |
|
|
import { |
|
|
import { |
|
|
List, |
|
|
|
|
|
ListItem, |
|
|
|
|
|
ListItemAvatar, |
|
|
|
|
|
ListItemText, |
|
|
|
|
|
Avatar, |
|
|
|
|
|
Divider, |
|
|
|
|
|
AppBar, |
|
|
AppBar, |
|
|
Badge, |
|
|
Badge, |
|
|
Box, |
|
|
Box, |
|
|
|
|
|
|
|
|
useMediaQuery, |
|
|
useMediaQuery, |
|
|
SvgIcon, |
|
|
SvgIcon, |
|
|
Typography, |
|
|
Typography, |
|
|
Button, |
|
|
|
|
|
} from "@mui/material"; |
|
|
} from "@mui/material"; |
|
|
import { useTheme } from "@mui/system"; |
|
|
import { useTheme } from "@mui/system"; |
|
|
import MenuOutlinedIcon from "@mui/icons-material/MenuOutlined"; |
|
|
import MenuOutlinedIcon from "@mui/icons-material/MenuOutlined"; |
|
|
|
|
|
import MailIcon from "@mui/icons-material/EmailOutlined"; |
|
|
import Autorenew from "@mui/icons-material/Autorenew"; |
|
|
import Autorenew from "@mui/icons-material/Autorenew"; |
|
|
import MailIcon from "@mui/icons-material/Mail"; |
|
|
|
|
|
import AccountCircle from "@mui/icons-material/AccountCircle"; |
|
|
|
|
|
|
|
|
import AccountCircle from "@mui/icons-material/PersonOutlineOutlined"; |
|
|
|
|
|
import SearchIcon from "@mui/icons-material/Search"; |
|
|
import Drawer from "./DrawerComponent"; |
|
|
import Drawer from "./DrawerComponent"; |
|
|
import { PrimaryButton } from "../Buttons/PrimaryButton/PrimaryButton"; |
|
|
import { PrimaryButton } from "../Buttons/PrimaryButton/PrimaryButton"; |
|
|
import { PRIMARY_YELLOW_COLOR } from "../../constants/stylesConstants"; |
|
|
import { PRIMARY_YELLOW_COLOR } from "../../constants/stylesConstants"; |
|
|
import { PRIMARY_PURPLE_COLOR } from "../../constants/stylesConstants"; |
|
|
import { PRIMARY_PURPLE_COLOR } from "../../constants/stylesConstants"; |
|
|
import EyeOn from "@mui/icons-material/Visibility"; |
|
|
|
|
|
import SearchIcon from "@mui/icons-material/Search"; |
|
|
|
|
|
import PopoverComponent from "./PopoverComponent"; |
|
|
import PopoverComponent from "./PopoverComponent"; |
|
|
|
|
|
import { MyPosts } from "../Popovers/MyPosts/MyPosts"; |
|
|
|
|
|
import { MyMessages } from "../Popovers/MyMessages/MyMessages"; |
|
|
|
|
|
import { MyProfile } from "../Popovers/MyProfile/MyProfile"; |
|
|
|
|
|
|
|
|
const NavbarComponent = () => { |
|
|
const NavbarComponent = () => { |
|
|
const [openDrawer, setOpenDrawer] = useState(false); |
|
|
const [openDrawer, setOpenDrawer] = useState(false); |
|
|
|
|
|
|
|
|
setPostsPopoverOpen(true); |
|
|
setPostsPopoverOpen(true); |
|
|
setPostsAnchorEl(e.currentTarget); |
|
|
setPostsAnchorEl(e.currentTarget); |
|
|
}} |
|
|
}} |
|
|
|
|
|
sx={{ borderRadius: "4px" }} |
|
|
> |
|
|
> |
|
|
<Autorenew /> |
|
|
<Autorenew /> |
|
|
<Typography sx={{ ml: 2 }}>Moje objave</Typography> |
|
|
<Typography sx={{ ml: 2 }}>Moje objave</Typography> |
|
|
|
|
|
|
|
|
setMsgPopoverOpen(true); |
|
|
setMsgPopoverOpen(true); |
|
|
setMsgAnchorEl(e.currentTarget); |
|
|
setMsgAnchorEl(e.currentTarget); |
|
|
}} |
|
|
}} |
|
|
|
|
|
sx={{ borderRadius: "4px" }} |
|
|
> |
|
|
> |
|
|
<Badge badgeContent={3} color="primary"> |
|
|
<Badge badgeContent={3} color="primary"> |
|
|
<MailIcon color="action" /> |
|
|
<MailIcon color="action" /> |
|
|
|
|
|
|
|
|
setUserPopoverOpen(true); |
|
|
setUserPopoverOpen(true); |
|
|
setUserAnchorEl(e.currentTarget); |
|
|
setUserAnchorEl(e.currentTarget); |
|
|
}} |
|
|
}} |
|
|
|
|
|
sx={{ borderRadius: "4px" }} |
|
|
> |
|
|
> |
|
|
<AccountCircle /> |
|
|
<AccountCircle /> |
|
|
<Typography sx={{ ml: 2 }}>Moj profil</Typography> |
|
|
<Typography sx={{ ml: 2 }}>Moj profil</Typography> |
|
|
|
|
|
|
|
|
setPostsPopoverOpen(true); |
|
|
setPostsPopoverOpen(true); |
|
|
setPostsAnchorEl(e.currentTarget); |
|
|
setPostsAnchorEl(e.currentTarget); |
|
|
}} |
|
|
}} |
|
|
sx={{ ml: 4, mr: 2 }} |
|
|
|
|
|
|
|
|
sx={{ |
|
|
|
|
|
ml: 4, |
|
|
|
|
|
mr: 2, |
|
|
|
|
|
background: "#E4E4E4", |
|
|
|
|
|
color: PRIMARY_PURPLE_COLOR, |
|
|
|
|
|
}} |
|
|
> |
|
|
> |
|
|
<Autorenew /> |
|
|
<Autorenew /> |
|
|
</IconButton> |
|
|
</IconButton> |
|
|
|
|
|
|
|
|
setMsgPopoverOpen(true); |
|
|
setMsgPopoverOpen(true); |
|
|
setMsgAnchorEl(e.currentTarget); |
|
|
setMsgAnchorEl(e.currentTarget); |
|
|
}} |
|
|
}} |
|
|
sx={{ mr: 2 }} |
|
|
|
|
|
|
|
|
sx={{ |
|
|
|
|
|
mr: 2, |
|
|
|
|
|
background: "#E4E4E4", |
|
|
|
|
|
color: PRIMARY_PURPLE_COLOR, |
|
|
|
|
|
}} |
|
|
> |
|
|
> |
|
|
<Badge badgeContent={3} color="primary"> |
|
|
<Badge badgeContent={3} color="primary"> |
|
|
<MailIcon color="action" /> |
|
|
|
|
|
|
|
|
<MailIcon /> |
|
|
</Badge> |
|
|
</Badge> |
|
|
</IconButton> |
|
|
</IconButton> |
|
|
<IconButton |
|
|
<IconButton |
|
|
|
|
|
|
|
|
setUserPopoverOpen(true); |
|
|
setUserPopoverOpen(true); |
|
|
setUserAnchorEl(e.currentTarget); |
|
|
setUserAnchorEl(e.currentTarget); |
|
|
}} |
|
|
}} |
|
|
|
|
|
sx={{ background: "#E4E4E4", color: PRIMARY_PURPLE_COLOR }} |
|
|
> |
|
|
> |
|
|
<AccountCircle /> |
|
|
<AccountCircle /> |
|
|
</IconButton> |
|
|
</IconButton> |
|
|
|
|
|
|
|
|
setPostsPopoverOpen(false); |
|
|
setPostsPopoverOpen(false); |
|
|
setPostsAnchorEl(null); |
|
|
setPostsAnchorEl(null); |
|
|
}} |
|
|
}} |
|
|
content={ |
|
|
|
|
|
<> |
|
|
|
|
|
<Typography |
|
|
|
|
|
sx={{ |
|
|
|
|
|
p: 2, |
|
|
|
|
|
background: PRIMARY_PURPLE_COLOR, |
|
|
|
|
|
color: "white", |
|
|
|
|
|
width: "100%", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
Moje objave |
|
|
|
|
|
</Typography> |
|
|
|
|
|
<List |
|
|
|
|
|
sx={{ width: "100%", maxWidth: 360, bgcolor: "background.paper" }} |
|
|
|
|
|
> |
|
|
|
|
|
<ListItem alignItems="flex-start"> |
|
|
|
|
|
<ListItemAvatar> |
|
|
|
|
|
<Avatar alt="Remy Sharp" src="/static/images/avatar/1.jpg" /> |
|
|
|
|
|
</ListItemAvatar> |
|
|
|
|
|
<ListItemText |
|
|
|
|
|
primary="Brunch this weekend?" |
|
|
|
|
|
secondary={ |
|
|
|
|
|
<React.Fragment> |
|
|
|
|
|
<Typography |
|
|
|
|
|
sx={{ display: "inline" }} |
|
|
|
|
|
component="span" |
|
|
|
|
|
variant="body2" |
|
|
|
|
|
color="text.primary" |
|
|
|
|
|
> |
|
|
|
|
|
Ali Connors |
|
|
|
|
|
</Typography> |
|
|
|
|
|
{" — I'll be in your neighborhood doing errands this…"} |
|
|
|
|
|
</React.Fragment> |
|
|
|
|
|
} |
|
|
|
|
|
/> |
|
|
|
|
|
</ListItem> |
|
|
|
|
|
<Divider variant="inset" component="li" /> |
|
|
|
|
|
<ListItem alignItems="flex-start"> |
|
|
|
|
|
<ListItemAvatar> |
|
|
|
|
|
<Avatar |
|
|
|
|
|
alt="Travis Howard" |
|
|
|
|
|
src="/static/images/avatar/2.jpg" |
|
|
|
|
|
/> |
|
|
|
|
|
</ListItemAvatar> |
|
|
|
|
|
<ListItemText |
|
|
|
|
|
primary="Summer BBQ" |
|
|
|
|
|
secondary={ |
|
|
|
|
|
<React.Fragment> |
|
|
|
|
|
<Typography |
|
|
|
|
|
sx={{ display: "inline" }} |
|
|
|
|
|
component="span" |
|
|
|
|
|
variant="body2" |
|
|
|
|
|
color="text.primary" |
|
|
|
|
|
> |
|
|
|
|
|
to Scott, Alex, Jennifer |
|
|
|
|
|
</Typography> |
|
|
|
|
|
{" — Wish I could come, but I'm out of town this…"} |
|
|
|
|
|
</React.Fragment> |
|
|
|
|
|
} |
|
|
|
|
|
/> |
|
|
|
|
|
</ListItem> |
|
|
|
|
|
<Divider variant="inset" component="li" /> |
|
|
|
|
|
<ListItem alignItems="flex-start"> |
|
|
|
|
|
<ListItemAvatar> |
|
|
|
|
|
<Avatar alt="Cindy Baker" src="/static/images/avatar/3.jpg" /> |
|
|
|
|
|
</ListItemAvatar> |
|
|
|
|
|
<ListItemText |
|
|
|
|
|
primary="Oui Oui" |
|
|
|
|
|
secondary={ |
|
|
|
|
|
<React.Fragment> |
|
|
|
|
|
<Typography |
|
|
|
|
|
sx={{ display: "inline" }} |
|
|
|
|
|
component="span" |
|
|
|
|
|
variant="body2" |
|
|
|
|
|
color="text.primary" |
|
|
|
|
|
> |
|
|
|
|
|
Sandra Adams |
|
|
|
|
|
</Typography> |
|
|
|
|
|
{" — Do you have Paris recommendations? Have you ever…"} |
|
|
|
|
|
</React.Fragment> |
|
|
|
|
|
} |
|
|
|
|
|
/> |
|
|
|
|
|
</ListItem> |
|
|
|
|
|
</List> |
|
|
|
|
|
<Button |
|
|
|
|
|
variant="text" |
|
|
|
|
|
endIcon={<EyeOn />} |
|
|
|
|
|
sx={{ |
|
|
|
|
|
textDecoration: "underline", |
|
|
|
|
|
float: "right", |
|
|
|
|
|
mr: 2, |
|
|
|
|
|
mb: 2, |
|
|
|
|
|
color: PRIMARY_PURPLE_COLOR, |
|
|
|
|
|
fontWeight: 500, |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
Pogledaj sve |
|
|
|
|
|
</Button> |
|
|
|
|
|
</> |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
content={<MyPosts />} |
|
|
/> |
|
|
/> |
|
|
<PopoverComponent |
|
|
<PopoverComponent |
|
|
anchorEl={msgAnchorEl} |
|
|
anchorEl={msgAnchorEl} |
|
|
|
|
|
|
|
|
setMsgPopoverOpen(false); |
|
|
setMsgPopoverOpen(false); |
|
|
setMsgAnchorEl(null); |
|
|
setMsgAnchorEl(null); |
|
|
}} |
|
|
}} |
|
|
content={ |
|
|
|
|
|
<> |
|
|
|
|
|
<Typography |
|
|
|
|
|
sx={{ |
|
|
|
|
|
p: 2, |
|
|
|
|
|
background: PRIMARY_PURPLE_COLOR, |
|
|
|
|
|
color: "white", |
|
|
|
|
|
width: "100%", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
Moje poruke |
|
|
|
|
|
</Typography> |
|
|
|
|
|
<List |
|
|
|
|
|
sx={{ width: "100%", maxWidth: 360, bgcolor: "background.paper" }} |
|
|
|
|
|
> |
|
|
|
|
|
<ListItem alignItems="flex-start"> |
|
|
|
|
|
<ListItemAvatar> |
|
|
|
|
|
<Avatar alt="Remy Sharp" src="/static/images/avatar/1.jpg" /> |
|
|
|
|
|
</ListItemAvatar> |
|
|
|
|
|
<ListItemText |
|
|
|
|
|
primary="Brunch this weekend?" |
|
|
|
|
|
secondary={ |
|
|
|
|
|
<React.Fragment> |
|
|
|
|
|
<Typography |
|
|
|
|
|
sx={{ display: "inline" }} |
|
|
|
|
|
component="span" |
|
|
|
|
|
variant="body2" |
|
|
|
|
|
color="text.primary" |
|
|
|
|
|
> |
|
|
|
|
|
Ali Connors |
|
|
|
|
|
</Typography> |
|
|
|
|
|
{" — I'll be in your neighborhood doing errands this…"} |
|
|
|
|
|
</React.Fragment> |
|
|
|
|
|
} |
|
|
|
|
|
/> |
|
|
|
|
|
</ListItem> |
|
|
|
|
|
<Divider variant="inset" component="li" /> |
|
|
|
|
|
<ListItem alignItems="flex-start"> |
|
|
|
|
|
<ListItemAvatar> |
|
|
|
|
|
<Avatar |
|
|
|
|
|
alt="Travis Howard" |
|
|
|
|
|
src="/static/images/avatar/2.jpg" |
|
|
|
|
|
/> |
|
|
|
|
|
</ListItemAvatar> |
|
|
|
|
|
<ListItemText |
|
|
|
|
|
primary="Summer BBQ" |
|
|
|
|
|
secondary={ |
|
|
|
|
|
<React.Fragment> |
|
|
|
|
|
<Typography |
|
|
|
|
|
sx={{ display: "inline" }} |
|
|
|
|
|
component="span" |
|
|
|
|
|
variant="body2" |
|
|
|
|
|
color="text.primary" |
|
|
|
|
|
> |
|
|
|
|
|
to Scott, Alex, Jennifer |
|
|
|
|
|
</Typography> |
|
|
|
|
|
{" — Wish I could come, but I'm out of town this…"} |
|
|
|
|
|
</React.Fragment> |
|
|
|
|
|
} |
|
|
|
|
|
/> |
|
|
|
|
|
</ListItem> |
|
|
|
|
|
<Divider variant="inset" component="li" /> |
|
|
|
|
|
<ListItem alignItems="flex-start"> |
|
|
|
|
|
<ListItemAvatar> |
|
|
|
|
|
<Avatar alt="Cindy Baker" src="/static/images/avatar/3.jpg" /> |
|
|
|
|
|
</ListItemAvatar> |
|
|
|
|
|
<ListItemText |
|
|
|
|
|
primary="Oui Oui" |
|
|
|
|
|
secondary={ |
|
|
|
|
|
<React.Fragment> |
|
|
|
|
|
<Typography |
|
|
|
|
|
sx={{ display: "inline" }} |
|
|
|
|
|
component="span" |
|
|
|
|
|
variant="body2" |
|
|
|
|
|
color="text.primary" |
|
|
|
|
|
> |
|
|
|
|
|
Sandra Adams |
|
|
|
|
|
</Typography> |
|
|
|
|
|
{" — Do you have Paris recommendations? Have you ever…"} |
|
|
|
|
|
</React.Fragment> |
|
|
|
|
|
} |
|
|
|
|
|
/> |
|
|
|
|
|
</ListItem> |
|
|
|
|
|
</List> |
|
|
|
|
|
<Button |
|
|
|
|
|
variant="text" |
|
|
|
|
|
endIcon={<EyeOn />} |
|
|
|
|
|
sx={{ |
|
|
|
|
|
textDecoration: "underline", |
|
|
|
|
|
float: "right", |
|
|
|
|
|
mr: 2, |
|
|
|
|
|
mb: 2, |
|
|
|
|
|
color: PRIMARY_PURPLE_COLOR, |
|
|
|
|
|
fontWeight: 500, |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
Pogledaj sve |
|
|
|
|
|
</Button> |
|
|
|
|
|
</> |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
content={<MyMessages />} |
|
|
/> |
|
|
/> |
|
|
<PopoverComponent |
|
|
<PopoverComponent |
|
|
anchorEl={userAnchorEl} |
|
|
anchorEl={userAnchorEl} |
|
|
|
|
|
|
|
|
setUserPopoverOpen(false); |
|
|
setUserPopoverOpen(false); |
|
|
setUserAnchorEl(null); |
|
|
setUserAnchorEl(null); |
|
|
}} |
|
|
}} |
|
|
content={ |
|
|
|
|
|
<> |
|
|
|
|
|
<Typography |
|
|
|
|
|
sx={{ |
|
|
|
|
|
p: 2, |
|
|
|
|
|
background: PRIMARY_PURPLE_COLOR, |
|
|
|
|
|
color: "white", |
|
|
|
|
|
width: "100%", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
Moj profil |
|
|
|
|
|
</Typography> |
|
|
|
|
|
<List |
|
|
|
|
|
sx={{ width: "100%", maxWidth: 360, bgcolor: "background.paper" }} |
|
|
|
|
|
> |
|
|
|
|
|
<ListItem alignItems="flex-start"> |
|
|
|
|
|
<ListItemAvatar> |
|
|
|
|
|
<Avatar alt="Remy Sharp" src="/static/images/avatar/1.jpg" /> |
|
|
|
|
|
</ListItemAvatar> |
|
|
|
|
|
<ListItemText |
|
|
|
|
|
primary="Brunch this weekend?" |
|
|
|
|
|
secondary={ |
|
|
|
|
|
<React.Fragment> |
|
|
|
|
|
<Typography |
|
|
|
|
|
sx={{ display: "inline" }} |
|
|
|
|
|
component="span" |
|
|
|
|
|
variant="body2" |
|
|
|
|
|
color="text.primary" |
|
|
|
|
|
> |
|
|
|
|
|
Ali Connors |
|
|
|
|
|
</Typography> |
|
|
|
|
|
{" — I'll be in your neighborhood doing errands this…"} |
|
|
|
|
|
</React.Fragment> |
|
|
|
|
|
} |
|
|
|
|
|
/> |
|
|
|
|
|
</ListItem> |
|
|
|
|
|
</List> |
|
|
|
|
|
<Button |
|
|
|
|
|
variant="text" |
|
|
|
|
|
endIcon={<EyeOn />} |
|
|
|
|
|
sx={{ |
|
|
|
|
|
textDecoration: "underline", |
|
|
|
|
|
float: "right", |
|
|
|
|
|
mr: 2, |
|
|
|
|
|
mb: 2, |
|
|
|
|
|
color: PRIMARY_PURPLE_COLOR, |
|
|
|
|
|
fontWeight: 500, |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
Pogledaj profil |
|
|
|
|
|
</Button> |
|
|
|
|
|
</> |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
content={<MyProfile />} |
|
|
/> |
|
|
/> |
|
|
</AppBar> |
|
|
</AppBar> |
|
|
); |
|
|
); |