import PropTypes from 'prop-types'; import BellIcon from '@heroicons/react/24/solid/BellIcon'; import UsersIcon from '@heroicons/react/24/solid/UsersIcon'; import PhoneIcon from '@heroicons/react/24/solid/PhoneIcon'; import Bars3Icon from '@heroicons/react/24/solid/Bars3Icon'; import MagnifyingGlassIcon from '@heroicons/react/24/solid/MagnifyingGlassIcon'; import { Avatar, Badge, Box, IconButton, Stack, SvgIcon, Tooltip, useMediaQuery, Dialog, DialogTitle, DialogActions, DialogContent, DialogContentText, Button } from '@mui/material'; import XMarkIcon from '@heroicons/react/24/outline/XMarkIcon'; import { alpha } from '@mui/material/styles'; import { usePopover } from 'src/hooks/use-popover'; import { AccountPopover } from './account-popover'; import { useAuth } from 'src/hooks/use-auth'; import { WsContext } from 'src/contexts/socketio-context'; import { useContext, useEffect } from 'react'; const SIDE_NAV_WIDTH = 280; const TOP_NAV_HEIGHT = 64; export const TopNav = (props) => { const { onNavOpen } = props; const lgUp = useMediaQuery((theme) => theme.breakpoints.up('lg')); const accountPopover = usePopover(); const auth = useAuth(); const { answerCall, call, callAccepted } = useContext(WsContext); return ( auth.user && <> alpha(theme.palette.background.default, 0.8), position: 'sticky', left: { lg: `${SIDE_NAV_WIDTH}px` }, top: 0, width: { lg: `calc(100% - ${SIDE_NAV_WIDTH}px)` }, zIndex: (theme) => theme.zIndex.appBar }} > {!lgUp && ( )} {/* */} {/* */} {call.isReceivingCall && !callAccepted && {call.from} {}}>
{}}>
} ); }; TopNav.propTypes = { onNavOpen: PropTypes.func };