diff --git a/src/components/AssignmentCard.js b/src/components/AssignmentCard.js index c8443a1..2889443 100644 --- a/src/components/AssignmentCard.js +++ b/src/components/AssignmentCard.js @@ -12,15 +12,30 @@ import dayjs from 'dayjs'; import { capitalizeFirstLetter } from '../utils/capitalizeFirstLetter'; function AssignmentCard({ title, classrooms, dueDate, scores, layoutType }) { + console.log(classrooms); switch (layoutType) { case 'desktop': return ( + {classrooms.length > 1 && + classrooms + .filter((_, i) => i > 0) + .map(c => ( +
+ ))} - {classrooms.map(c => c.name).join(',')} + {classrooms.map(c => c.name).join(', ')} Valor: - {scores.map(s => s.value).join(',')} pts + {scores.map(s => s.value).join(', ')} pts @@ -85,10 +100,24 @@ function AssignmentCard({ title, classrooms, dueDate, scores, layoutType }) { > + {classrooms.length > 1 && + classrooms + .filter((_, i) => i > 0) + .map(c => ( +
+ ))} - {classrooms.map(c => c.name).join(',')} + {classrooms.map(c => c.name).join(', ')} Valor: - {scores.map(s => s.value).join(',')} pts + {scores.map(s => s.value).join(', ')} pts diff --git a/src/context/user.js b/src/context/user.js index 4a97767..c6242ca 100644 --- a/src/context/user.js +++ b/src/context/user.js @@ -194,6 +194,49 @@ const getAssignments = userId => }, ], }, + { + id: '1717', + title: 'Trabalho interdisciplinar', + dueDate: '2022-08-20 23:59', + scores: [ + { + classroomId: '666', + value: 20, + }, + { + classroomId: '321', + value: 30, + }, + ], + classrooms: [ + { + id: '666', + name: 'Banco de Dados II', + abbreviation: 'BDII', + color: '#FF7A00', + teachers: [ + { + name: 'Cristiane Norbiato Targa', + avatar: + 'https://lh3.googleusercontent.com/a-/AOh14GhwNeQ0h2eKl2WXGuwyDzvLWtrvyrG2kJtZ7A1EBw=s75-c', + }, + ], + }, + { + id: '321', + name: 'Introdução à Ciência de Dados', + abbreviation: 'ICD', + color: '#006FF2', + teachers: [ + { + name: 'Carlos Alexandre Silva', + avatar: + 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=50&q=80', + }, + ], + }, + ], + }, ], }; }); diff --git a/src/screens/Home/index.js b/src/screens/Home/index.js index f0b50d9..665ec23 100644 --- a/src/screens/Home/index.js +++ b/src/screens/Home/index.js @@ -70,7 +70,13 @@ function Home() {

Atividades

Atribuídas

- + {assignments === null ? ( Array(6) .fill()