Skip to content

Commit

Permalink
Merge pull request #117 from suvarnakale/shiksha-2.0
Browse files Browse the repository at this point in the history
Issue #PS-295 feat: react-calender library package and isssues on das…
  • Loading branch information
itsvick authored May 16, 2024
2 parents b43ecff + 1495f44 commit 1d2ab01
Show file tree
Hide file tree
Showing 8 changed files with 230 additions and 133 deletions.
94 changes: 94 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@
"prettier": "prettier --write ."
},
"dependencies": {
"next-i18next": "^15.3.0",
"i18next": "^23.11.4",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@mui/icons-material": "^5.15.15",
"@mui/material": "^5.15.15",
"axios": "^1.6.8",
"date-fns": "^3.6.0",
"i18next": "^23.11.4",
"i18next-resources-to-backend": "^1.2.1",
"next": "14.1.4",
"next-i18next": "^15.3.0",
"prettier": "^3.2.5",
"react": "^18",
"react-calendar": "^5.0.0",
"react-circular-progressbar": "^2.1.0",
"react-dom": "^18",
"sharp": "^0.33.3"
Expand Down
4 changes: 2 additions & 2 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"CLASS": "Class",
"NOT_MARKED": "Not Marked",
"FUTURE_DATE_CANT_MARK": "Future date can't be marked",
"PERCENT_ATTENDANCE": "% Attendance",
"PRESENT_STUDENTS": " present",
"PERCENT_ATTENDANCE": "{{percent_students}}% Attendance",
"PRESENT_STUDENTS": "({{present_students}}/{{total_students}} present)",
"OVERVIEW": "Overview",
"MORE_DETAILS": "More Details",
"MENU": "Menu",
Expand Down
4 changes: 2 additions & 2 deletions public/locales/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"CLASS": "कक्षा",
"NOT_MARKED": "नहीं चिह्नित",
"FUTURE_DATE_CANT_MARK": "भविष्य की तारीख कोई चिह्नित नहीं की जा सकती",
"PERCENT_ATTENDANCE": "% उपस्थिति",
"PRESENT_STUDENTS": " मौजूद हैं",
"PERCENT_ATTENDANCE": "{{percent_students}}% उपस्थिति",
"PRESENT_STUDENTS": "({{present_students}}/{{total_students}} मौजूद हैं)",
"OVERVIEW": "अवलोकन",
"MORE_DETAILS": "अधिक विवरण",
"MENU": "मेनू",
Expand Down
4 changes: 2 additions & 2 deletions public/locales/mr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"CLASS": "वर्ग",
"NOT_MARKED": "नोंद केलेले नाही",
"FUTURE_DATE_CANT_MARK": "भविष्यातील तारीख कोणताही नोंद करण्यास योग्य नाही",
"PERCENT_ATTENDANCE": "% उपस्थिती",
"PRESENT_STUDENTS": " उपस्थित",
"PERCENT_ATTENDANCE": "{{percent_students}}% उपस्थिती",
"PRESENT_STUDENTS": "({{present_students}}/{{total_students}} उपस्थित)",
"OVERVIEW": "अवलोकन",
"MORE_DETAILS": "अधिक माहिती",
"MENU": "मेनू",
Expand Down
14 changes: 2 additions & 12 deletions src/components/MonthCalender.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useState, useMemo, useEffect } from 'react';
import PropTypes from 'prop-types';
import Calendar from 'react-calendar';
import 'react-calendar/dist/Calendar.css';
import {
Expand Down Expand Up @@ -28,7 +27,7 @@ const MonthCalender: React.FC<CalendarWithAttendanceProps> = ({
onChange,
onDateChange,
}) => {
const [date, setDate] = useState(new Date());
const [date, setDate] = useState(() => new Date());
const reducedPresentDates = useMemo(
() => reduceDatesByOneDay(presentDates),
[presentDates]
Expand Down Expand Up @@ -172,7 +171,7 @@ const MonthCalender: React.FC<CalendarWithAttendanceProps> = ({
tileContent={tileContent}
tileClassName={tileClassName}
calendarType="gregory"
className="calender-body suvarna"
className="calender-body"
formatShortWeekday={formatShortWeekday}
onActiveStartDateChange={handleActiveStartDateChange}
/>
Expand All @@ -181,13 +180,4 @@ const MonthCalender: React.FC<CalendarWithAttendanceProps> = ({
);
};

MonthCalender.propTypes = {
presentDates: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
absentDates: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
halfDayDates: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
notMarkedDates: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
onChange: PropTypes.func.isRequired,
onDateChange: PropTypes.func.isRequired,
};

export default MonthCalender;
Loading

0 comments on commit 1d2ab01

Please sign in to comment.