diff --git a/src/screens/Classroom/AssignmentsTab/index.js b/src/screens/Classroom/AssignmentsTab/index.js index 7f0eae1..0c39a13 100644 --- a/src/screens/Classroom/AssignmentsTab/index.js +++ b/src/screens/Classroom/AssignmentsTab/index.js @@ -1,18 +1,25 @@ import { Container, Link, Skeleton, Stack, Typography } from '@mui/material'; import dayjs from 'dayjs'; import { capitalizeFirstLetter } from '../../../utils/capitalizeFirstLetter'; -import { createArrayFrom1ToN } from '../../../utils/createArrayFrom1ToN'; +import styles from './styles'; function AssignmentsTab({ assignmentsTabData, layoutType }) { const layoutResolver = (state, assignments, layoutType) => { + const { + externalContainer, + innerContainer, + sectionTitle, + assignmentContainer, + assignmentTypography, + assignmentLink, + assignmentDueDate, + assignmentScores, + } = styles[layoutType]; if (layoutType === 'desktop') { switch (state) { case 'loading': return ( - + - - + + + Provas @@ -104,26 +101,19 @@ function AssignmentsTab({ assignmentsTabData, layoutType }) { .map(a => ( - + {a.title} @@ -133,7 +123,7 @@ function AssignmentsTab({ assignmentsTabData, layoutType }) { )} @@ -145,18 +135,8 @@ function AssignmentsTab({ assignmentsTabData, layoutType }) { - - + + Trabalhos @@ -165,26 +145,19 @@ function AssignmentsTab({ assignmentsTabData, layoutType }) { .map(a => ( {a.title} @@ -194,7 +167,7 @@ function AssignmentsTab({ assignmentsTabData, layoutType }) { )} @@ -278,19 +251,9 @@ function AssignmentsTab({ assignmentsTabData, layoutType }) { case 'idle': return ( - - - + + + Provas @@ -299,35 +262,19 @@ function AssignmentsTab({ assignmentsTabData, layoutType }) { .map(a => ( - + {a.title} @@ -337,7 +284,7 @@ function AssignmentsTab({ assignmentsTabData, layoutType }) { )} @@ -349,18 +296,8 @@ function AssignmentsTab({ assignmentsTabData, layoutType }) { - - + + Trabalhos @@ -369,35 +306,19 @@ function AssignmentsTab({ assignmentsTabData, layoutType }) { .map(a => ( - + {a.title} @@ -407,7 +328,7 @@ function AssignmentsTab({ assignmentsTabData, layoutType }) { )} diff --git a/src/screens/Classroom/AssignmentsTab/styles.js b/src/screens/Classroom/AssignmentsTab/styles.js new file mode 100644 index 0000000..d23a456 --- /dev/null +++ b/src/screens/Classroom/AssignmentsTab/styles.js @@ -0,0 +1,120 @@ +// ========== Desktop ========== +const desktopExternalContainer = { + marginTop: '50px', + height: '100vh', +}; + +const desktopInnerContainer = { + width: '90%', + marginBottom: '30px', +}; + +const desktopSectionTitle = { + padding: '10px', + borderBottom: '2px solid #00420D', + color: '#00420D', +}; + +const desktopAssignmentContainer = { + width: '95%', + padding: '20px', + borderBottom: '2px solid #BCBCBC', +}; + +const desktopAssignmentTypography = {}; + +const desktopAssignmentLink = { + color: 'black', + textDecoration: 'underline #000000', +}; + +const desktopAssignmentDueDate = { + marginTop: '15px', + fontSize: '15px', +}; + +const desktopAssignmentScores = { + fontSize: '15px', +}; + +const desktop = { + externalContainer: desktopExternalContainer, + innerContainer: desktopInnerContainer, + sectionTitle: desktopSectionTitle, + assignmentContainer: desktopAssignmentContainer, + assignmentTypography: desktopAssignmentTypography, + assignmentLink: desktopAssignmentLink, + assignmentDueDate: desktopAssignmentDueDate, + assignmentScores: desktopAssignmentScores, +}; + +// ========== Mobile ========== +const mobileExternalContainer = { + marginTop: '50px', + height: '100vh', +}; + +const mobileInnerContainer = { + width: '100%', + marginBottom: '30px', +}; + +const mobileSectionTitle = { + padding: '10px', + borderBottom: '2px solid #00420D', + color: '#00420D', +}; + +const mobileAssignmentContainer = { + width: '100%', + padding: '20px', + borderBottom: '2px solid #BCBCBC', +}; + +const mobileAssignmentTypography = { + overflow: 'hidden', + textOverflow: 'ellipsis', + display: '-webkit-box', + WebkitLineClamp: 2, + WebkitBoxOrient: 'vertical', +}; + +const mobileAssignmentLink = { + color: 'black', + textDecoration: 'underline #000000', +}; + +const mobileAssignmentDueDate = { + marginTop: '10px', + fontSize: '12px', +}; + +const mobileAssignmentScores = { + fontSize: '12px', +}; + +const mobile = { + externalContainer: mobileExternalContainer, + innerContainer: mobileInnerContainer, + sectionTitle: mobileSectionTitle, + assignmentContainer: mobileAssignmentContainer, + assignmentTypography: mobileAssignmentTypography, + assignmentLink: mobileAssignmentLink, + assignmentDueDate: mobileAssignmentDueDate, + assignmentScores: mobileAssignmentScores, +}; + +// ========== Unset ========== +const unset = { + externalContainer: null, + innerContainer: null, + sectionTitle: null, + assignmentContainer: null, + assignmentTypography: null, + assignmentLink: null, + assignmentDueDate: null, + assignmentScores: null, +}; + +const styles = { desktop, mobile, unset }; +export default styles;