diff --git a/src/screens/professor/Classroom/AnnouncementsTab/index.js b/src/screens/professor/Classroom/AnnouncementsTab/index.js index 1154538..28d8311 100644 --- a/src/screens/professor/Classroom/AnnouncementsTab/index.js +++ b/src/screens/professor/Classroom/AnnouncementsTab/index.js @@ -1,8 +1,10 @@ +import { useState } from 'react'; import { Button, Card, Container, Grid, + Link, Skeleton, Stack, Typography, @@ -13,7 +15,6 @@ import styles from './styles'; import jitsiLogo from '../../../../assets/jitsi.svg'; import { createArrayFrom1ToN } from '../../../../utils/createArrayFrom1ToN'; import PublishAnnouncementCard from '../../../../components/PublishAnnouncementCard'; -import { useState } from 'react'; function AnnouncementsTab({ layoutType, @@ -90,6 +91,21 @@ function AnnouncementsTab({ >

Próximas Atividades

+ {announcementsTabData.upcomingAssignments.length !== 0 ? ( + announcementsTabData.upcomingAssignments.map(ua => ( + + {ua.title} + + )) + ) : ( + +

Nenhuma atividade encontrada!

+
+ )}

Próximas Atividades

+ + {announcementsTabData.upcomingAssignments.length !== 0 ? ( + announcementsTabData.upcomingAssignments.map(ua => ( + + {ua.title} + + )) + ) : ( + +

Nenhuma atividade encontrada!

+
+ )}
ProfessorApi.getPeopleByClassId(classId); fetchGradesByClassId = classId => ProfessorApi.getGradesByClassId(classId); + + fetchUpcomingAssignmentsByClassId = classId => + ProfessorApi.getUpcomingAssignmentsByClassId(classId); } diff --git a/src/utils/mocks/api.js b/src/utils/mocks/api.js index 2a2b66b..6076993 100644 --- a/src/utils/mocks/api.js +++ b/src/utils/mocks/api.js @@ -72,6 +72,16 @@ const CommonApi = { data: allPeople.filter(p => p.classes[0].id === classId), }; }), + + getUpcomingAssignmentsByClassId: classId => + sleep(300).then(() => { + console.log('Getting upcoming assignments by class id ' + classId); + return { + data: allUpcomingAssignments.filter( + a => a.classrooms.filter(c => c.id === classId)[0] + ), + }; + }), }; const StudentApi = { @@ -84,16 +94,6 @@ const StudentApi = { }; }), - getUpcomingAssignmentsByClassId: classId => - sleep(300).then(() => { - console.log('Getting upcoming assignments by class id ' + classId); - return { - data: allUpcomingAssignments.filter( - a => a.classrooms.filter(c => c.id === classId)[0] - ), - }; - }), - getAllAssignments: userId => sleep(400).then(() => { console.log('Getting all assignments ' + userId);