Skip to content

Commit

Permalink
Merge pull request #35 from Aar-if/patchFacilitator
Browse files Browse the repository at this point in the history
Issue #PS-1389 feat: Issue #PS-1098 feat: Show Facilitators list into the selected center
  • Loading branch information
itsvick authored Jul 19, 2024
2 parents f564ec5 + a9e5059 commit 921a80c
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 80 deletions.
3 changes: 2 additions & 1 deletion src/components/CohortLearnerList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
toPascalCase,
} from '@/utils/Helper';
import LearnersListItem from '@/components/LearnersListItem';
import { Status, limit } from '@/utils/app.constant';
import { Role, Status, limit } from '@/utils/app.constant';
import { showToastMessage } from './Toastify';
import { useTranslation } from 'next-i18next';
import { Box, Typography } from '@mui/material';
Expand Down Expand Up @@ -85,6 +85,7 @@ const CohortLearnerList: React.FC<CohortLearnerListProp> = ({
{userData?.map((data: any) => {
return (
<LearnersListItem
type={Role.STUDENT}
key={data.userId}
userId={data.userId}
learnerName={data.name}
Expand Down
159 changes: 80 additions & 79 deletions src/components/LearnersListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const centerList = ['Nashik', 'Shirdi', 'kamptee'];
const centers = ['shirdi'];

const LearnersListItem: React.FC<LearnerListProps> = ({
type,
userId,
learnerName,
isDropout,
Expand Down Expand Up @@ -496,85 +497,85 @@ const LearnersListItem: React.FC<LearnerListProps> = ({
</Box>

<BottomDrawer
toggleDrawer={toggleDrawer}
state={state}
listItemClick={listItemClick}
optionList={
block
? [
{
label: t('COMMON.REASSIGN_BLOCKS_REQUEST'),
icon: (
<LocationOnOutlinedIcon
sx={{ color: theme.palette.warning['300'] }}
/>
),
name: 'reassign-block-request',
},
{
label: t('COMMON.REASSIGN_CENTERS'),
icon: (
<ApartmentIcon
sx={{ color: theme.palette.warning['300'] }}
/>
),
name: 'reassign-centers',
},
{
label: isDropout
? t('COMMON.UNMARK_DROP_OUT')
: t('COMMON.MARK_DROP_OUT'),
icon: (
<NoAccountsIcon
sx={{ color: theme.palette.warning['300'] }}
/>
),
name: isDropout ? 'unmark-drop-out' : 'mark-drop-out',
},
{
label: t('COMMON.DELETE_USER'),
icon: (
<DeleteOutlineIcon
sx={{ color: theme.palette.warning['300'] }}
/>
),
name: 'delete-User',
},
]
: [
{
label: t('COMMON.REASSIGN_CENTERS'),
icon: (
<ApartmentIcon
sx={{ color: theme.palette.warning['300'] }}
/>
),
name: 'reassign-centers',
},
{
label: isDropout
? t('COMMON.UNMARK_DROP_OUT')
: t('COMMON.MARK_DROP_OUT'),
icon: (
<NoAccountsIcon
sx={{ color: theme.palette.warning['300'] }}
/>
),
name: isDropout ? 'unmark-drop-out' : 'mark-drop-out',
},
{
label: t('COMMON.DELETE_USER'),
icon: (
<DeleteOutlineIcon
sx={{ color: theme.palette.warning['300'] }}
/>
),
name: 'delete-User',
},
]
}
renderCustomContent={renderCustomContent}
/>
toggleDrawer={toggleDrawer}
state={state}
listItemClick={listItemClick}
optionList={
block
? [
{
label: t('COMMON.REASSIGN_BLOCKS_REQUEST'),
icon: (
<LocationOnOutlinedIcon
sx={{ color: theme.palette.warning['300'] }}
/>
),
name: 'reassign-block-request',
},
{
label: t('COMMON.REASSIGN_CENTERS'),
icon: (
<ApartmentIcon
sx={{ color: theme.palette.warning['300'] }}
/>
),
name: 'reassign-centers',
},
{
label: isDropout
? t('COMMON.UNMARK_DROP_OUT')
: t('COMMON.MARK_DROP_OUT'),
icon: (
<NoAccountsIcon
sx={{ color: theme.palette.warning['300'] }}
/>
),
name: isDropout ? 'unmark-drop-out' : 'mark-drop-out',
},
{
label: t('COMMON.DELETE_USER'),
icon: (
<DeleteOutlineIcon
sx={{ color: theme.palette.warning['300'] }}
/>
),
name: 'delete-User',
},
].filter(option => type == Role.STUDENT || option.name !== 'mark-drop-out' && option.name !== 'unmark-drop-out')
: [
{
label: t('COMMON.REASSIGN_CENTERS'),
icon: (
<ApartmentIcon
sx={{ color: theme.palette.warning['300'] }}
/>
),
name: 'reassign-centers',
},
{
label: isDropout
? t('COMMON.UNMARK_DROP_OUT')
: t('COMMON.MARK_DROP_OUT'),
icon: (
<NoAccountsIcon
sx={{ color: theme.palette.warning['300'] }}
/>
),
name: isDropout ? 'unmark-drop-out' : 'mark-drop-out',
},
{
label: t('COMMON.DELETE_USER'),
icon: (
<DeleteOutlineIcon
sx={{ color: theme.palette.warning['300'] }}
/>
),
name: 'delete-User',
},
].filter(option => type == Role.STUDENT || option.name !== 'mark-drop-out' && option.name !== 'unmark-drop-out')
}
renderCustomContent={renderCustomContent}
/>

{isDropout ? (
<DropOutModal
Expand Down
1 change: 1 addition & 0 deletions src/utils/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ export interface updateCohortMemberStatusParams {
}

export interface LearnerListProps {
type?: string;
userId: string;
isDropout: boolean;
enrollmentId?: string | number;
Expand Down

0 comments on commit 921a80c

Please sign in to comment.