Skip to content

Commit

Permalink
Issue #PS-000 fix: Fixed lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
itsvick committed Sep 8, 2024
1 parent 2d3a654 commit a506045
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 31 deletions.
1 change: 0 additions & 1 deletion src/components/ReassignModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ const ReassignModal: React.FC<ReassignModalProps> = ({
showToastMessage(t('MANAGE_USERS.CENTERS_REQUEST_FAILED'), 'error');
} finally {
handleCloseReassignModal();
return;
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/SessionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ const SessionsCard: React.FC<SessionsCardProps> = ({
</Box>
{showEdit && (
<EditOutlined
onClick={() => handleOpen?.(data)}
onClick={() => handleOpen(data)}
sx={{ cursor: 'pointer' }}
/>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/components/WeekCalender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const Calendar: React.FC<any> = ({
return (
<div
className="days row"
style={{ width: showFromToday ? '100%' : '100%' }}
style={{ width: '100%' }}
>
{days}
</div>
Expand Down Expand Up @@ -195,7 +195,7 @@ const Calendar: React.FC<any> = ({
}

return (
<div className="body" style={{ width: showFromToday ? '100%' : '100%' }}>
<div className="body" style={{ width: '100%' }}>
{rows}
</div>
);
Expand Down
14 changes: 3 additions & 11 deletions src/pages/attendance-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -612,17 +612,9 @@ const AttendanceOverview: React.FC<AttendanceOverviewProps> = () => {
/>
))}
valuePartOne={
Array.isArray(lowAttendanceLearnerList) &&
lowAttendanceLearnerList.length > 2
? `${lowAttendanceLearnerList[0]}, ${lowAttendanceLearnerList[1]}`
: lowAttendanceLearnerList.length === 2
? `${lowAttendanceLearnerList[0]}, ${lowAttendanceLearnerList[1]}`
: lowAttendanceLearnerList.length === 1
? `${lowAttendanceLearnerList[0]}`
: Array.isArray(lowAttendanceLearnerList) &&
lowAttendanceLearnerList.length === 0
? t('ATTENDANCE.NO_LEARNER_WITH_LOW_ATTENDANCE')
: t('ATTENDANCE.NO_LEARNER_WITH_LOW_ATTENDANCE')
lowAttendanceLearnerList.length > 0
? lowAttendanceLearnerList.slice(0, 2).join(", ")
: t('ATTENDANCE.NO_LEARNER_WITH_LOW_ATTENDANCE')
}
valuePartTwo={
Array.isArray(lowAttendanceLearnerList) &&
Expand Down
33 changes: 17 additions & 16 deletions src/pages/centers/[cohortId]/events/[date]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
import React, { useEffect, useState } from 'react';
import Header from '@/components/Header';
import KeyboardBackspaceOutlinedIcon from '@mui/icons-material/KeyboardBackspaceOutlined';
import { Session } from '../../../../../utils/Interfaces';
import SessionCardFooter from '@/components/SessionCardFooter';
import MonthCalender from '@/components/MonthCalender';
import SessionsCard from '@/components/SessionCard';
import SessionCardFooter from '@/components/SessionCardFooter';
import { getEventList } from '@/services/EventService';
import { logEvent } from '@/utils/googleAnalytics';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'next-i18next';
import { Box, Typography } from '@mui/material';
import {
getAfterDate,
getBeforeDate,
shortDateFormat,
sortSessionsByTime,
} from '@/utils/Helper';
import { getEventList } from '@/services/EventService';
import { showToastMessage } from '@/components/Toastify';
import MonthCalender from '@/components/MonthCalender';
import { useRouter } from 'next/router';
import { GetStaticPaths } from 'next';
import withAccessControl from '@/utils/hoc/withAccessControl';
import KeyboardBackspaceOutlinedIcon from '@mui/icons-material/KeyboardBackspaceOutlined';
import { Box, Typography } from '@mui/material';
import { useTheme } from '@mui/material/styles';
import { GetStaticPaths } from 'next';
import { useTranslation } from 'next-i18next';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import { useRouter } from 'next/router';
import React, { useEffect, useState } from 'react';
import { accessControl } from '../../../../../../app.config';
import { Session } from '../../../../../utils/Interfaces';

const eventMonthView = () => {
const EventMonthView:React.FC<any> = () => {
const theme = useTheme<any>();
const { t } = useTranslation();
const router = useRouter();
Expand Down Expand Up @@ -241,7 +240,6 @@ const eventMonthView = () => {
);
};


export async function getStaticProps({ locale }: { locale: string }) {
return {
props: {
Expand All @@ -257,4 +255,7 @@ export const getStaticPaths: GetStaticPaths<{ slug: string }> = async () => {
};
};

export default withAccessControl('accessCenters', accessControl)(eventMonthView);
export default withAccessControl(
'accessCenters',
accessControl
)(EventMonthView);

0 comments on commit a506045

Please sign in to comment.