Skip to content

Commit

Permalink
Resolve style check
Browse files Browse the repository at this point in the history
  • Loading branch information
itnoj15 committed Feb 21, 2024
1 parent bc0b8ba commit fbb1ace
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/app/courses/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,31 @@ export default function Page() {
{COURSES.map(({ code, title, description, editions }, i) => (
<>
<Section key={i}>
<SectionTitle>{code} {title}</SectionTitle>
<SectionTitle>
{code} {title}
</SectionTitle>
<SectionContent>{description}</SectionContent>
<SectionGroup>
{groupEditions(editions).map((editionGroup, i) => (
<SectionEditions key={i}>
{editionGroup.map((edition: any, i: any) => (
<SectionEdition key={i} href={edition.url}>{edition.semester}</SectionEdition>
))}
</SectionEditions>
))}
{groupEditions(editions).map((editionGroup, i) => (
<SectionEditions key={i}>
{editionGroup.map((edition: any, i: any) => (
<SectionEdition key={i} href={edition.url}>
{' '}
{edition.semester}
</SectionEdition>
))}
</SectionEditions>
))}
</SectionGroup>
</Section>
{i < COURSES.length - 1 && <HorizontalLine />}
{i < COURSES.length - 1 && <HorizontalLine />}
</>
))}
</Sections>
</main>
)
}


const Sections = styled.div`
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -89,9 +93,9 @@ const HorizontalLine = styled.hr`
`

function groupEditions(editions: any) {
const groupedEditions = [];
const groupedEditions = []
for (let i = 0; i < editions.length; i += 3) {
groupedEditions.push(editions.slice(i, i + 3));
groupedEditions.push(editions.slice(i, i + 3))
}
return groupedEditions;
}
return groupedEditions
}

0 comments on commit fbb1ace

Please sign in to comment.