-
Notifications
You must be signed in to change notification settings - Fork 0
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 #63 from NASA-PDS/features/create-components-for-h…
…omepage Features/create components for homepage
- Loading branch information
Showing
19 changed files
with
767 additions
and
83 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
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,69 @@ | ||
import { Box as MuiBox, Card as MuiCard, Stack as MuiStack } from "@mui/material"; | ||
import { Typography } from "components/Typography"; | ||
import { IconArrowRight, IconArrowDiagonal } from "components/Icons"; | ||
|
||
export type ButtonCardProps = { | ||
title: string; | ||
linkType?:"internal" | "external"; | ||
width?:string; | ||
} | ||
|
||
export const ButtonCard = ({ | ||
title, | ||
linkType = "internal", | ||
width = "100%" | ||
}:ButtonCardProps) => { | ||
|
||
let icon = <IconArrowRight style={{ width: "10px", height: "10px" }} /> | ||
|
||
if( linkType === "external" ) { | ||
icon = <IconArrowDiagonal style={{ width: "10px", height: "10px" }} /> | ||
} | ||
|
||
return <> | ||
<MuiCard sx={{ | ||
boxShadow:'none', | ||
borderRadius: "0px", | ||
':focus': { | ||
border: '1px dotted', | ||
}, | ||
height: "250px", | ||
width | ||
}}> | ||
<MuiBox sx={{ | ||
width: "100%", | ||
height: "100%", | ||
backgroundColor: "#FFFFFF", | ||
}}> | ||
<MuiBox sx={{ | ||
display: "flex", | ||
flexGrow: 1, | ||
width: "100%", | ||
height: "100%", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
}}> | ||
<MuiBox sx={{padding: "20px"}}> | ||
<MuiStack direction={"row"} spacing={"4px"} alignItems={"center"} width={"100%"} justifyContent={"space-between"}> | ||
<Typography variant={"h5"} weight={"semibold"} component={"span"}>{title}</Typography> | ||
<div style={{ | ||
display: "flex", | ||
backgroundColor: "#F64137", | ||
padding: "5px", | ||
width: "10px", | ||
height: "10px", | ||
borderRadius: "10px", | ||
color: "#FFFFFF" | ||
}} | ||
> | ||
{icon} | ||
</div> | ||
</MuiStack> | ||
</MuiBox> | ||
</MuiBox> | ||
</MuiBox> | ||
</MuiCard> | ||
</> | ||
} | ||
|
||
export default ButtonCard; |
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 @@ | ||
export * from "./ButtonCard"; |
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,95 @@ | ||
import { | ||
Box as MuiBox, | ||
Card as MuiCard, | ||
CardMedia as MuiCardMedia, | ||
CardMediaProps as MuiCardMediaProps, | ||
Stack as MuiStack | ||
} from "@mui/material"; | ||
import { Typography } from "components/Typography"; | ||
import { IconArrowRight } from "components/Icons"; | ||
import testImage from '../../../nasaTest.jpeg'; | ||
|
||
export type MediaCardProps = { | ||
description?:string; | ||
image:MuiCardMediaProps['image']; | ||
imageDescription:string; | ||
title:string; | ||
} | ||
|
||
export const MediaCard = ({ | ||
description, | ||
image = testImage, | ||
imageDescription, | ||
title, | ||
}:MediaCardProps) => { | ||
|
||
return <> | ||
<MuiCard sx={{ | ||
height: "250px", | ||
boxShadow: "none", | ||
':focus': { | ||
border: '1px dotted', | ||
}, | ||
borderRadius: "0px", | ||
transition: "none" | ||
}}> | ||
<MuiBox sx={{ | ||
width: "100%", | ||
height: "100%", | ||
position: 'relative', | ||
}}> | ||
<MuiCardMedia | ||
component="img" | ||
image={image} | ||
width={"100%"} | ||
height={"100%"} | ||
sx={{ backgroundSize: "cover"}} | ||
alt={imageDescription} | ||
/> | ||
<MuiBox | ||
sx={{ | ||
position: 'absolute', | ||
bottom: 0, | ||
left: 0, | ||
width: "100%", | ||
height: '50%', | ||
background: 'linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1))', | ||
color: 'white', | ||
}} | ||
/> | ||
<MuiBox | ||
sx={{ | ||
position: 'absolute', | ||
bottom: 0, | ||
left: 0, | ||
color: 'white', | ||
padding: '20px 20px', | ||
gap: "12px", | ||
display: "flex", | ||
flexDirection: "column", | ||
flexWrap: "wrap" | ||
}} | ||
> | ||
<MuiStack direction={"row"} spacing={"4px"} alignItems={"flex-end"} width={"100%"} justifyContent={"space-between"}> | ||
<Typography variant={"h5"} weight={"semibold"} component={"span"}>{title}</Typography> | ||
<div style={{ | ||
display: "flex", | ||
backgroundColor: "#F64137", | ||
padding: "5px", | ||
width: "10px", | ||
height: "10px", | ||
borderRadius: "10px", | ||
color: "#FFFFFF" | ||
}} | ||
> | ||
<IconArrowRight style={{ width: "10px", height: "10px" }}/> | ||
</div> | ||
</MuiStack> | ||
{ description && <Typography variant="body2" weight="regular">{description}</Typography> } | ||
</MuiBox> | ||
</MuiBox> | ||
</MuiCard> | ||
</> | ||
} | ||
|
||
export default MediaCard; |
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 @@ | ||
export * from "./MediaCard"; |
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,2 @@ | ||
export * from "./ButtonCard"; | ||
export * from "./MediaCard"; |
Oops, something went wrong.