-
-
- ←
-
- Back
-
-
-
+ const renderMenteeList = () => (
+
+
+
Mentee Applications
+
+
+ {tabData.map((tab) => (
+ {
+ setActiveTab(tab.status);
+ }}
+ >
+ {tab.label}
+
+ {menteeApplications?.filter((m) => m.state === tab.status)
+ .length || 0}
+
+
+ ))}
+
+
+ {filteredApplications.map(renderMenteeLink)}
+ {filteredApplications.length === 0 && (
+
No mentee applications available.
+ )}
+
+
+ );
+
+ return (
+
+ {isMobile ? (
- } />
+
+ {
+ navigate('/mentor/dashboard');
+ }}
+ isMobile={isMobile}
+ />
+ }
+ />
+ ) : (
+ <>
+ {renderMenteeList()}
+
+
+ } />
+ {}} isMobile={isMobile} />
+ }
+ />
+
+
+ >
+ )}
+
+ );
+};
+
+const WelcomeMessage: React.FC = () => (
+
+
+ Welcome to the ScholarX Mentee Dashboard!
+
+
+ Here, you can view your mentees and provide feedback on their monthly
+ check-ins. Click on a mentee to view their profile and their monthly
+ check-in submissions.
+
+
+);
+
+const MenteeDetails: React.FC<{ onBack: () => void; isMobile: boolean }> = ({
+ onBack,
+ isMobile,
+}) => {
+ const { menteeId } = useParams<{ menteeId: string }>();
+ const [showGuidelines, setShowGuidelines] = useState(true);
+
+ const toggleGuidelines = () => {
+ setShowGuidelines((prev) => !prev);
+ };
+
+ const {
+ data: checkInHistory = [],
+ isLoading,
+ refetch,
+ } = useMonthlyCheckIns(menteeId ?? '');
+
+ return (
+
+ {isMobile && (
+
+ ← Back to Mentee List
+
+ )}
+
+
+
+
+
+ Monthly Check-Ins
+
+
+
+
);
diff --git a/src/schemas.ts b/src/schemas.ts
index 35988a8a..0e6850ae 100644
--- a/src/schemas.ts
+++ b/src/schemas.ts
@@ -105,12 +105,23 @@ export const MentorApplicationSchema = z.object({
});
export const MenteeCheckInSchema = z.object({
- generalUpdate: z.string().min(1, 'Please provide general updates'),
- progressUpdate: z.string().min(1, 'Please summarize your progress'),
- mediaLink: z
+ title: z.string().min(1, 'Title is required'),
+ generalUpdatesAndFeedback: z
.string()
- .url('Please provide a valid URL')
- .min(1, 'Please provide a media link'),
+ .min(5, 'Please provide general updates'),
+ progressTowardsGoals: z.string().min(5, 'Please summarize your progress'),
+ mediaContentLinks: z
+ .array(z.string().url('Please provide a valid URL'))
+ .min(1, 'Please provide at least 1 media links'),
+});
+
+export const MentorFeedbackSchema = z.object({
+ menteeId: z.string().min(1, 'Mentee ID is required'),
+ checkInId: z.string().min(1, 'Check-in ID is required'),
+ mentorFeedback: z.string().optional(),
+ isCheckedByMentor: z.literal(true, {
+ errorMap: () => ({ message: 'You must mark this as checked' }),
+ }),
});
export const mentorTermsAgreementModalSchema = z.object({
diff --git a/src/types.ts b/src/types.ts
index 2c4bfe98..15d4bba7 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -2,6 +2,7 @@ import { type z } from 'zod';
import {
type MentorApplicationSchema,
type MenteeApplicationSchema,
+ MenteeCheckInSchema,
} from './schemas';
import {
type StatusUpdatedBy,
@@ -102,3 +103,38 @@ export interface PasswordUpdateData {
token: string;
newPassword: string;
}
+
+export type MenteeCheckInForm = z.infer
;
+
+export interface MonthlyCheckIn {
+ uuid: string;
+ title: string;
+ checkInDate: string;
+ mediaContentLinks: string[];
+ isCheckedByMentor: boolean;
+ mentorCheckedDate: string;
+ mentorFeedback: string;
+ generalUpdatesAndFeedback: string;
+ progressTowardsGoals?: string;
+ mentee: Mentee;
+}
+
+export interface MonthlyCheckingProps {
+ isMentorView: boolean;
+ menteeId: string;
+}
+
+export interface MentorFeedbackForm {
+ checkInId: string;
+ menteeId: string;
+ mentorFeedback: string;
+ isCheckedByMentor: boolean;
+}
+
+export interface NotificationProps {
+ iconColor?: string;
+ badgeColor?: string;
+ textColor?: string;
+ count?: number;
+ className?: string;
+}
diff --git a/src/utils.ts b/src/utils.ts
index 92425c82..b5003fbd 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -1,3 +1,5 @@
+import { format, isValid, parseISO } from 'date-fns';
+
export const getStateColor = (state: string | undefined) => {
switch (state) {
case 'pending':
@@ -12,3 +14,11 @@ export const getStateColor = (state: string | undefined) => {
return 'bg-gray-100 text-gray-700';
}
};
+
+export const formatDate = (dateString: string | null | undefined): string => {
+ if (!dateString) return 'Date not available';
+ const date = parseISO(dateString);
+ return isValid(date)
+ ? format(date, 'MMMM dd, yyyy, hh:mm a')
+ : 'Invalid date';
+};