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)
.map(c => (
<div
key={c.id}
style={{
position: 'absolute',
width: '100%',

View file

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