♻ Move project source files to top level from src, update Sentry dependency (#630)

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
Esteban Maya
2024-03-07 11:35:33 -05:00
committed by GitHub
parent ae83b89113
commit 8558cf00a2
248 changed files with 4 additions and 6 deletions

View File

@@ -0,0 +1,43 @@
import React from 'react';
import { Box, IconButton, Menu, MenuButton, MenuItem, MenuList } from '@chakra-ui/react';
import { FaUserAstronaut } from 'react-icons/fa';
import { FiLogOut, FiUser } from 'react-icons/fi';
import { Link } from 'react-router-dom';
import useAuth from '../../hooks/useAuth';
const UserMenu: React.FC = () => {
const { logout } = useAuth();
const handleLogout = async () => {
logout()
};
return (
<>
{/* Desktop */}
<Box display={{ base: 'none', md: 'block' }} position='fixed' top={4} right={4}>
<Menu>
<MenuButton
as={IconButton}
aria-label='Options'
icon={<FaUserAstronaut color='white' fontSize='18px' />}
bg='ui.main'
isRound
/>
<MenuList>
<MenuItem icon={<FiUser fontSize='18px' />} as={Link} to='settings'>
My profile
</MenuItem>
<MenuItem icon={<FiLogOut fontSize='18px' />} onClick={handleLogout} color='ui.danger' fontWeight='bold'>
Log out
</MenuItem>
</MenuList>
</Menu>
</Box>
</>
);
};
export default UserMenu;