Use new util function to create array

This commit is contained in:
Leonardo Murça 2022-06-26 22:47:56 -03:00
parent 4a411c7779
commit 51f66aa6cd
2 changed files with 17 additions and 20 deletions

View file

@ -110,6 +110,7 @@ function AssignmentCard({ title, classrooms, dueDate, scores, layoutType }) {
.filter((_, i) => i > 0) .filter((_, i) => i > 0)
.map(c => ( .map(c => (
<div <div
key={c.id}
style={{ style={{
position: 'absolute', position: 'absolute',
width: '100%', width: '100%',

View file

@ -95,16 +95,14 @@ function View({ layoutType, classrooms, assignments }) {
gap="30px" gap="30px"
> >
{classrooms === null ? ( {classrooms === null ? (
Array(6) createArrayFrom1ToN(6).map(i => (
.fill() <Skeleton
.map((_, index) => ( key={i}
<Skeleton variant="rectangular"
key={index} width="100%"
variant="rectangular" height={245}
width="100%" />
height={245} ))
/>
))
) : classrooms.length !== 0 ? ( ) : classrooms.length !== 0 ? (
classrooms.map(classroom => ( classrooms.map(classroom => (
<ClassCard <ClassCard
@ -131,16 +129,14 @@ function View({ layoutType, classrooms, assignments }) {
gap="30px" gap="30px"
> >
{assignments === null ? ( {assignments === null ? (
Array(6) createArrayFrom1ToN(6).map(i => (
.fill() <Skeleton
.map((_, index) => ( key={i}
<Skeleton variant="rectangular"
key={index} width="100%"
variant="rectangular" height={245}
width="100%" />
height={245} ))
/>
))
) : assignments.length !== 0 ? ( ) : assignments.length !== 0 ? (
assignments.map(assignment => ( assignments.map(assignment => (
<AssignmentCard <AssignmentCard