Skip to content

Commit

Permalink
Merge pull request #523 from Rushikesh-Sonawane99/release-1.0.0
Browse files Browse the repository at this point in the history
Issue #PS-000 chore: Disabled reassign button for the user's own cohort in Reassign Modal
  • Loading branch information
itsvick authored Dec 15, 2024
2 parents 8921e45 + 4c77916 commit 69b0002
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/ManageCentersModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const ManageCentersModal: React.FC<ManageUsersModalProps> = ({
const { t } = useTranslation();
const [checkedCenters, setCheckedCenters] = React.useState<string[]>([]);
const [selectedValue, setSelectedValue] = React.useState('');
const [userClass, setUserClass] = React.useState('');
const [searchQuery, setSearchQuery] = React.useState('');
const setCohortId = reassignLearnerStore((state) => state.setCohortId);

Expand All @@ -62,6 +63,7 @@ const ManageCentersModal: React.FC<ManageUsersModalProps> = ({
const classData: string | null = localStorage.getItem('className');
if (classData) {
setSelectedValue(classData);
setUserClass(classData);
}
}
}, []);
Expand Down Expand Up @@ -225,6 +227,7 @@ const ManageCentersModal: React.FC<ManageUsersModalProps> = ({
sx={{ boxShadow: 'none' }}
variant="contained"
onClick={handleAssign}
disabled={selectedValue === userClass}
>
{t('COMMON.ASSIGN')}
</Button>
Expand Down

0 comments on commit 69b0002

Please sign in to comment.