update bugs fix medicine, user record update-delete, user login

This commit is contained in:
2024-01-05 12:22:56 +07:00
parent 7c820547c0
commit 87f2788cdd
30 changed files with 505 additions and 96 deletions

View File

@@ -30,8 +30,9 @@ const MENU_OPTIONS = [
export default function AccountPopover() {
const [open, setOpen] = useState<HTMLElement | null>(null);
const navigate = useNavigate();
const { logout } = useAuth();
const { logout, user } = useAuth();
console.log(user?.email)
const handleOpen = (event: React.MouseEvent<HTMLElement>) => {
setOpen(event.currentTarget);
};
@@ -65,7 +66,7 @@ export default function AccountPopover() {
}}
>
<Avatar
src="https://minimal-assets-api.vercel.app/assets/images/avatars/avatar_5.jpg"
src="https://linksehat.com/assets/img/users/dummy.jpg"
alt="Rayan Moran"
/>
</IconButtonAnimate>
@@ -86,10 +87,10 @@ export default function AccountPopover() {
>
<Box sx={{ my: 1.5, px: 2.5 }}>
<Typography variant="subtitle2" noWrap>
Rayan Moran
{user?.full_name ? user?.full_name : ''}
</Typography>
<Typography variant="body2" sx={{ color: 'text.secondary' }} noWrap>
rayan.moran@gmail.com
{user?.email}
</Typography>
</Box>

View File

@@ -92,9 +92,9 @@ export default function DashboardHeader({
<Box sx={{ flexGrow: 1 }} />
<Stack direction="row" alignItems="center" spacing={{ xs: 0.5, sm: 1.5 }}>
<LanguagePopover />
{/* <LanguagePopover />
<NotificationsPopover />
<ContactsPopover />
<ContactsPopover /> */}
<AccountPopover />
</Stack>
</Toolbar>

View File

@@ -108,7 +108,10 @@ const navConfig = [
},
{
title: 'USER MANAGEMENT',
path: '/users',
children: [
{ title: 'User Access', path: '/master/diagnosis' },
{ title: 'User Role', path: '/master/diagnosis' },
],
},
{
title: 'LINKING TOOLS',

View File

@@ -1,6 +1,7 @@
// @mui
import { styled } from '@mui/material/styles';
import { Box, Link, Typography, Avatar } from '@mui/material';
import useAuth from '../../../hooks/useAuth';
// ----------------------------------------------------------------------
@@ -22,6 +23,8 @@ type Props = {
};
export default function NavbarAccount({ isCollapse }: Props) {
const { logout, user } = useAuth();
return (
<Link underline="none" color="inherit">
<RootStyle
@@ -32,7 +35,7 @@ export default function NavbarAccount({ isCollapse }: Props) {
}}
>
<Avatar
src="https://minimal-assets-api.vercel.app/assets/images/avatars/avatar_5.jpg"
src="https://linksehat.com/assets/img/users/dummy.jpg"
alt="Rayan Moran"
/>
@@ -50,10 +53,10 @@ export default function NavbarAccount({ isCollapse }: Props) {
}}
>
<Typography variant="subtitle2" noWrap>
Rayan Moran
</Typography>
<Typography variant="body2" noWrap sx={{ color: 'text.secondary' }}>
user
Hi {user?.full_name}
</Typography>
</Box>
</RootStyle>