-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #939 from research-software-directory/935-software…
…-masonry-card 932 & 935 Software overview page improvements
- Loading branch information
Showing
3 changed files
with
57 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters