From 9128e80dc3a704e826f6b15b3fc43b03ef8ccb99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Mur=C3=A7a?= Date: Thu, 25 Aug 2022 19:15:25 -0300 Subject: [PATCH] Add mobile assignments tab layout --- src/screens/Classroom/AssignmentsTab/index.js | 204 +++++++++++++++++- 1 file changed, 202 insertions(+), 2 deletions(-) diff --git a/src/screens/Classroom/AssignmentsTab/index.js b/src/screens/Classroom/AssignmentsTab/index.js index bafd34a..7f0eae1 100644 --- a/src/screens/Classroom/AssignmentsTab/index.js +++ b/src/screens/Classroom/AssignmentsTab/index.js @@ -1,6 +1,7 @@ import { Container, Link, Skeleton, Stack, Typography } from '@mui/material'; import dayjs from 'dayjs'; import { capitalizeFirstLetter } from '../../../utils/capitalizeFirstLetter'; +import { createArrayFrom1ToN } from '../../../utils/createArrayFrom1ToN'; function AssignmentsTab({ assignmentsTabData, layoutType }) { const layoutResolver = (state, assignments, layoutType) => { @@ -216,10 +217,209 @@ function AssignmentsTab({ assignmentsTabData, layoutType }) { } else if (layoutType === 'mobile') { switch (state) { case 'loading': - return

Loading...

; + return ( + + + + + + + + + + + + ); case 'idle': - return

Assignments Tab

; + return ( + + + + Provas + + + {assignments + .filter(a => a.type === 'assessment') + .map(a => ( + + + + {a.title} + + + + Data de entrega: {' '} + {capitalizeFirstLetter( + dayjs(a.dueDate).format('dddd, DD/MM | HH:mm[h]') + )} + + + Valor: + {a.scores.map(s => s.value).join(', ')} pts + + + ))} + + + + + + Trabalhos + + + {assignments + .filter(a => a.type === 'project') + .map(a => ( + + + + {a.title} + + + + Data de entrega: {' '} + {capitalizeFirstLetter( + dayjs(a.dueDate).format('dddd, DD/MM | HH:mm[h]') + )} + + + Valor: + {a.scores.map(s => s.value).join(', ')} pts + + + ))} + + + + ); case 'gone': return null;