Skip to content

Commit

Permalink
ui: add Software Hightlights text
Browse files Browse the repository at this point in the history
  • Loading branch information
dmijatovic authored and ewan-escience committed Jul 26, 2023
1 parent b9e6cf0 commit 16848d3
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
42 changes: 42 additions & 0 deletions frontend/components/layout/ContentContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// SPDX-FileCopyrightText: 2023 Dusan Mijatovic (Netherlands eScience Center)
// SPDX-FileCopyrightText: 2023 Netherlands eScience Center
//
// SPDX-License-Identifier: Apache-2.0

type ContentContainerProps = {
element?: 'section' | 'article' | 'main' | 'div'
className?: string
children: JSX.Element | JSX.Element[]
}

export default function ContentContainer(props: ContentContainerProps) {
// basic container alignment - for lg + breakpoints
const classes = `px-4 lg:container lg:mx-auto ${props.className ?? ''}`

switch (props?.element) {
case 'section':
return (
<section className={classes}>
{props.children}
</section>
)
case 'article':
return (
<article className={classes}>
{props.children}
</article>
)
case 'main':
return (
<main className={classes}>
{props.children}
</main>
)
default:
return (
<div className={classes}>
{props.children}
</div>
)
}
}
8 changes: 8 additions & 0 deletions frontend/components/software/overview/SoftwareHighlights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//
// SPDX-License-Identifier: Apache-2.0

import ContentContainer from '~/components/layout/ContentContainer'
import {HighlightsCarousel} from './highlights/HighlightsCarousel'
import {SoftwareHighlight} from '~/components/admin/software-highlights/apiSoftwareHighlights'

Expand All @@ -20,6 +21,13 @@ export default function SoftwareHighlights({highlights}: { highlights: SoftwareH

return (
<div className="mt-8">
<ContentContainer>
<div
className="text-3xl"
>
Software Highlights
</div>
</ContentContainer>
<HighlightsCarousel items={highlights} />
</div>
)
Expand Down

0 comments on commit 16848d3

Please sign in to comment.