From 2dacb6d8d2c91bcce4c07d30f1ade9c0cb84433d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Mur=C3=A7a?= Date: Sat, 17 Sep 2022 12:48:23 -0300 Subject: [PATCH] Extract css to separated file and create mobile layout for assignment --- src/screens/Assignment/View.js | 90 ++++++----------- src/screens/Assignment/styles.js | 167 +++++++++++++++++++++++++++++++ 2 files changed, 196 insertions(+), 61 deletions(-) create mode 100644 src/screens/Assignment/styles.js diff --git a/src/screens/Assignment/View.js b/src/screens/Assignment/View.js index 25fcbe4..1829f22 100644 --- a/src/screens/Assignment/View.js +++ b/src/screens/Assignment/View.js @@ -3,55 +3,45 @@ import { Box, Button, Container, Stack, Typography } from '@mui/material'; import dayjs from 'dayjs'; import { capitalizeFirstLetter } from '../../utils/capitalizeFirstLetter'; +import styles from './styles'; + function View({ assignment, dropzone, layoutType }) { + const { + container, + headerStack, + title, + classroomColorStack, + classroomColor, + subHeaderStack, + subHeaderTypography, + descriptionStack, + dropzoneStack, + dropzoneBox, + button, + } = styles[layoutType]; + return assignment === null ? (

Loading...

) : ( - - - + + + {assignment.title} - + {assignment.classrooms.map(c => ( -
+
))} {assignment.classrooms.map(c => c.name).join(', ')}
- - + + Valor: {assignment.scores.map(s => s.value).join(', ')} pts - + Data de entrega: {capitalizeFirstLetter( dayjs(assignment.dueDate).format('dddd, DD/MM | HH:mm[h]') @@ -59,39 +49,17 @@ function View({ assignment, dropzone, layoutType }) { - +
{parse(assignment.description)}
;
- + {/* TODO: Create a custom component for dropzone */} - + Clique ou arraste um arquivo até aqui @@ -103,7 +71,7 @@ function View({ assignment, dropzone, layoutType }) { ))}