nice little menu for help and other things
This commit is contained in:
@@ -37,7 +37,7 @@ import {
|
|||||||
FiVideoOff,
|
FiVideoOff,
|
||||||
FiX,
|
FiX,
|
||||||
} from 'react-icons/fi';
|
} from 'react-icons/fi';
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
|
|
||||||
import ConversationLabel from '../subcomponents/ConversationLabel';
|
import ConversationLabel from '../subcomponents/ConversationLabel';
|
||||||
import { SUPPORT_DISPLAY_NAME } from '../util/support';
|
import { SUPPORT_DISPLAY_NAME } from '../util/support';
|
||||||
@@ -50,22 +50,21 @@ import useZen from '../providers/ZenProvider';
|
|||||||
export default function FooterControls() {
|
export default function FooterControls() {
|
||||||
const { handleFlowState } = useZen();
|
const { handleFlowState } = useZen();
|
||||||
|
|
||||||
const { omniSearch } = useSearch();
|
|
||||||
const { selectedConversation } = useConversations();
|
const { selectedConversation } = useConversations();
|
||||||
const { user, handleLogout } = useAuth();
|
const { user, handleLogout } = useAuth();
|
||||||
|
|
||||||
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
|
const [openUserSettings, setOpenUserSettings] = useState<boolean>(false);
|
||||||
const open = Boolean(anchorEl);
|
|
||||||
const handleClickProfileMenu = (event: React.MouseEvent<HTMLElement>) => {
|
|
||||||
setAnchorEl(event.currentTarget);
|
|
||||||
};
|
|
||||||
const handleCloseProfileMenu = () => {
|
|
||||||
setAnchorEl(null);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleQuickDialSupport = useCallback(() => {
|
const handleClickProfile = useCallback(
|
||||||
omniSearch(SUPPORT_DISPLAY_NAME);
|
(event: React.MouseEvent<HTMLElement>) => {
|
||||||
}, [omniSearch]);
|
setOpenUserSettings(true);
|
||||||
|
},
|
||||||
|
[setOpenUserSettings],
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleCloseUserSettings = useCallback(() => {
|
||||||
|
setOpenUserSettings(false);
|
||||||
|
}, [setOpenUserSettings]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -96,7 +95,7 @@ export default function FooterControls() {
|
|||||||
>
|
>
|
||||||
<Stack spacing={1} direction={'row'} alignItems={'center'}>
|
<Stack spacing={1} direction={'row'} alignItems={'center'}>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={handleClickProfileMenu}
|
onClick={handleClickProfile}
|
||||||
size="small"
|
size="small"
|
||||||
sx={{ borderRadius: 1 }}
|
sx={{ borderRadius: 1 }}
|
||||||
aria-controls={open ? 'account-menu' : undefined}
|
aria-controls={open ? 'account-menu' : undefined}
|
||||||
@@ -238,36 +237,20 @@ export default function FooterControls() {
|
|||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Menu
|
<UserSettingsDialog open={openUserSettings} handleClose={handleCloseUserSettings} />
|
||||||
anchorEl={anchorEl}
|
|
||||||
id="account-menu"
|
|
||||||
open={open}
|
|
||||||
onClose={handleCloseProfileMenu}
|
|
||||||
transformOrigin={{ horizontal: 'right', vertical: 'bottom' }}
|
|
||||||
anchorOrigin={{ horizontal: 'right', vertical: 'top' }}
|
|
||||||
>
|
|
||||||
<MenuItem onClick={handleQuickDialSupport}>
|
|
||||||
<ListItemIcon>
|
|
||||||
<FiHelpCircle />
|
|
||||||
</ListItemIcon>
|
|
||||||
<Typography>Help</Typography>
|
|
||||||
</MenuItem>
|
|
||||||
|
|
||||||
<Divider />
|
|
||||||
<MenuItem onClick={handleLogout}>
|
|
||||||
<ListItemIcon>
|
|
||||||
<FiLogOut />
|
|
||||||
</ListItemIcon>
|
|
||||||
<Typography color="warning">Logout</Typography>
|
|
||||||
</MenuItem>
|
|
||||||
</Menu>
|
|
||||||
|
|
||||||
<UserSettingsDialog open={true} handleClose={() => console.log('hi')} />
|
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function UserSettingsDialog({ open, handleClose }: { handleClose: () => void; open: boolean }) {
|
function UserSettingsDialog({ open, handleClose }: { handleClose: () => void; open: boolean }) {
|
||||||
|
const { user, handleLogout } = useAuth();
|
||||||
|
|
||||||
|
const { omniSearch } = useSearch();
|
||||||
|
const handleQuickDialSupport = useCallback(() => {
|
||||||
|
omniSearch(SUPPORT_DISPLAY_NAME);
|
||||||
|
handleClose();
|
||||||
|
}, [omniSearch, handleClose]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog maxWidth={'sm'} open={open} fullWidth onClose={handleClose}>
|
<Dialog maxWidth={'sm'} open={open} fullWidth onClose={handleClose}>
|
||||||
<Container
|
<Container
|
||||||
@@ -304,8 +287,6 @@ function UserSettingsDialog({ open, handleClose }: { handleClose: () => void; op
|
|||||||
</Button>
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Divider />
|
|
||||||
|
|
||||||
<FormControl fullWidth>
|
<FormControl fullWidth>
|
||||||
<InputLabel>Microphone</InputLabel>
|
<InputLabel>Microphone</InputLabel>
|
||||||
<Select value={'Macbook Pro High Definition'} label="Microphone">
|
<Select value={'Macbook Pro High Definition'} label="Microphone">
|
||||||
@@ -337,7 +318,7 @@ function UserSettingsDialog({ open, handleClose }: { handleClose: () => void; op
|
|||||||
</Select>
|
</Select>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
||||||
<FormControl fullWidth>
|
<FormControl fullWidth disabled>
|
||||||
<InputLabel>Screen</InputLabel>
|
<InputLabel>Screen</InputLabel>
|
||||||
<Select value={'Chrome browser - stack overflow'} label="Audio">
|
<Select value={'Chrome browser - stack overflow'} label="Audio">
|
||||||
<MenuItem value="">
|
<MenuItem value="">
|
||||||
@@ -350,6 +331,34 @@ function UserSettingsDialog({ open, handleClose }: { handleClose: () => void; op
|
|||||||
<MenuItem value={30}>Thirty</MenuItem>
|
<MenuItem value={30}>Thirty</MenuItem>
|
||||||
</Select>
|
</Select>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
||||||
|
<Divider />
|
||||||
|
|
||||||
|
<Stack flexDirection={'row'} justifyContent={'space-between'} alignItems={'center'}>
|
||||||
|
<Typography variant="subtitle2">Questions?</Typography>
|
||||||
|
|
||||||
|
<Button variant={'text'}>Resources</Button>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
<Divider />
|
||||||
|
|
||||||
|
<Stack flexDirection={'row'} justifyContent={'space-between'} alignItems={'center'}>
|
||||||
|
<Typography variant="subtitle2">Help, feedback, and more?</Typography>
|
||||||
|
|
||||||
|
<Button variant={'text'} onClick={handleQuickDialSupport}>
|
||||||
|
Contact Us
|
||||||
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
<Divider />
|
||||||
|
|
||||||
|
<Stack flexDirection={'row'} justifyContent={'space-between'} alignItems={'center'}>
|
||||||
|
<Typography variant="subtitle2">Account</Typography>
|
||||||
|
|
||||||
|
<Button variant={'text'} onClick={handleLogout} color={'error'}>
|
||||||
|
log out
|
||||||
|
</Button>
|
||||||
|
</Stack>
|
||||||
</Container>
|
</Container>
|
||||||
</Container>
|
</Container>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|||||||
Reference in New Issue
Block a user