Skip to content

Commit

Permalink
improving the story cards
Browse files Browse the repository at this point in the history
  • Loading branch information
MattReimer committed Dec 12, 2023
1 parent e2118b1 commit 4ec1241
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: Tool Standards
description: "Tool Standards"
blurb: "Tools that follow RC standards are labeled RC-Compliant"
image: ../../../card-image.jpg
imageAlt: "Image Alt Sample"
banner: true
---

Expand Down
9 changes: 8 additions & 1 deletion theme/src/components/ImgCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@ interface ImgCardProps {

const ImgCard: React.FC<ImgCardProps> = ({ to, img, imgAlt, heading, headingVariant, children }) => {
const theme = useTheme()
const imgIsString = typeof img === 'string'
return (
<Card>
<CardActionArea component={Link} to={to}>
<GatsbyImage image={img} alt={imgAlt} />
{imgIsString ? (
<Box>
<img src={img} alt={imgAlt} style={{ width: '100%', height: '100%', objectFit: 'cover' }} />
</Box>
) : (
<GatsbyImage image={img} alt={imgAlt} />
)}
<CardContent>
<Typography gutterBottom variant={headingVariant} component="div">
{heading}
Expand Down

0 comments on commit 4ec1241

Please sign in to comment.