Skip to content

Commit

Permalink
Merge branch 'main' into task-19-27-30-31-32
Browse files Browse the repository at this point in the history
  • Loading branch information
3laaHisham authored Nov 14, 2023
2 parents 92cbaec + c29aff0 commit 31a4d1b
Show file tree
Hide file tree
Showing 8 changed files with 425 additions and 136 deletions.
5 changes: 5 additions & 0 deletions client/src/layouts/dashboard/config-navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ const navConfig = [
path: '/medical-history',
icon: icon('ic_disabled')
},
{
title: 'My Health Records',
path: '/health-record',
icon: icon('ic_analytics'),
},
{
title: 'Not found',
path: '/404',
Expand Down
11 changes: 9 additions & 2 deletions client/src/sections/user/user-table-head.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import PropTypes from 'prop-types';

import Box from '@mui/material/Box';
import TableRow from '@mui/material/TableRow';
import Checkbox from '@mui/material/Checkbox';
Expand Down Expand Up @@ -66,7 +65,15 @@ UserTableHead.propTypes = {
order: PropTypes.oneOf(['asc', 'desc']),
orderBy: PropTypes.string,
rowCount: PropTypes.number,
headLabel: PropTypes.array,
headLabel: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
align: PropTypes.string,
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
minWidth: PropTypes.number,
})
),
numSelected: PropTypes.number,
onRequestSort: PropTypes.func,
onSelectAllClick: PropTypes.func,
Expand Down
77 changes: 26 additions & 51 deletions client/src/sections/user/user-table-row.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useState } from 'react';
import PropTypes from 'prop-types';

import Stack from '@mui/material/Stack';
import Avatar from '@mui/material/Avatar';
import Popover from '@mui/material/Popover';
Expand All @@ -10,20 +9,19 @@ import MenuItem from '@mui/material/MenuItem';
import TableCell from '@mui/material/TableCell';
import Typography from '@mui/material/Typography';
import IconButton from '@mui/material/IconButton';

import Label from 'src/components/label';
import Iconify from 'src/components/iconify';

// ----------------------------------------------------------------------

export default function UserTableRow({
selected,
name,
avatarUrl,
company,
role,
isVerified,
_id,
patientName,
doctorName,
status,
sessionPrice,
startDate,
endDate,
isFollowUp,
handleClick,
}) {
const [open, setOpen] = useState(null);
Expand All @@ -45,61 +43,38 @@ export default function UserTableRow({

<TableCell component="th" scope="row" padding="none">
<Stack direction="row" alignItems="center" spacing={2}>
<Avatar alt={name} src={avatarUrl} />
<Typography variant="subtitle2" noWrap>
{name}
{doctorName}
</Typography>
</Stack>
</TableCell>

<TableCell>{company}</TableCell>
<TableCell>{patientName}</TableCell>

<TableCell>{role}</TableCell>
<TableCell>{status}</TableCell>

<TableCell align="center">{isVerified ? 'Yes' : 'No'}</TableCell>
<TableCell>{sessionPrice}</TableCell>

<TableCell>
<Label color={(status === 'banned' && 'error') || 'success'}>{status}</Label>
</TableCell>
<TableCell>{startDate}</TableCell>

<TableCell align="right">
<IconButton onClick={handleOpenMenu}>
<Iconify icon="eva:more-vertical-fill" />
</IconButton>
</TableCell>
</TableRow>
<TableCell>{endDate}</TableCell>

<Popover
open={!!open}
anchorEl={open}
onClose={handleCloseMenu}
anchorOrigin={{ vertical: 'top', horizontal: 'left' }}
transformOrigin={{ vertical: 'top', horizontal: 'right' }}
PaperProps={{
sx: { width: 140 },
}}
>
<MenuItem onClick={handleCloseMenu}>
<Iconify icon="eva:edit-fill" sx={{ mr: 2 }} />
Edit
</MenuItem>

<MenuItem onClick={handleCloseMenu} sx={{ color: 'error.main' }}>
<Iconify icon="eva:trash-2-outline" sx={{ mr: 2 }} />
Delete
</MenuItem>
</Popover>
<TableCell>{isFollowUp ? 'Yes' : 'No'}</TableCell>
</TableRow>
</>
);
}


UserTableRow.propTypes = {
avatarUrl: PropTypes.any,
company: PropTypes.any,
handleClick: PropTypes.func,
isVerified: PropTypes.any,
name: PropTypes.any,
role: PropTypes.any,
selected: PropTypes.any,
_id: PropTypes.string.isRequired,
doctorName: PropTypes.string,
patientName: PropTypes.string,
status: PropTypes.string,
};
sessionPrice: PropTypes.number,
startDate: PropTypes.string,
endDate: PropTypes.string,
isFollowUp: PropTypes.bool,
selected: PropTypes.bool,
handleClick: PropTypes.func,
};
Loading

0 comments on commit 31a4d1b

Please sign in to comment.