-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
127 additions
and
61 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,67 @@ | ||
import React from 'react'; | ||
import VStack from "./VStack"; | ||
import HStack from "./HStack"; | ||
import {Link} from 'react-router-dom'; | ||
import {Typography} from '@mui/material'; | ||
import InfoCard from "./InfoCard"; | ||
import AccessTimeIcon from '@mui/icons-material/AccessTime'; | ||
|
||
const ClickCard = ({ | ||
link, | ||
time, | ||
title, | ||
subtitle, | ||
backgroundImage, | ||
cardHeight = '175px', | ||
titleColor = 'white', | ||
subtitleColor = 'white', | ||
icon = AccessTimeIcon, | ||
iconColor = "green" | ||
}) => { | ||
return ( | ||
<VStack data-testid="card-container" | ||
sx={{...styles.card, height: cardHeight, backgroundImage: `url(${backgroundImage})`}}> | ||
<Link to={link} style={{textDecoration: 'none', color: "black", width: '100%'}}> | ||
<VStack justifyContent={'space-between'}> | ||
<HStack justifyContent={'flex-end'} gap={1}> | ||
<InfoCard icon={icon} iconColor={iconColor} text={time}/> | ||
</HStack> | ||
<HStack justifyContent={'flex-start'} gap={1}> | ||
<VStack gap={0} justifyContent={'flex-end'}> | ||
<Typography sx={{...styles.cardContentTitle, color: titleColor}}> | ||
{title} | ||
</Typography> | ||
<Typography sx={{...styles.cardContentSubTitle, color: subtitleColor}}> | ||
{subtitle} | ||
</Typography> | ||
</VStack> | ||
</HStack> | ||
</VStack> | ||
</Link> | ||
</VStack> | ||
); | ||
}; | ||
|
||
export default ClickCard; | ||
|
||
const styles = { | ||
card: { | ||
height: '175px', | ||
padding: '16px', | ||
borderRadius: '15px', | ||
backgroundSize: 'cover', | ||
backgroundPosition: 'center', | ||
backgroundRepeat: 'no-repeat', | ||
boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)', | ||
}, | ||
cardContentTitle: { | ||
fontSize: '36px', | ||
fontWeight: 'bold', | ||
color: "white" | ||
}, | ||
cardContentSubTitle: { | ||
fontSize: '16px', | ||
fontWeight: '400', | ||
color: "white" | ||
} | ||
}; |
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 @@ | ||
import React from 'react'; | ||
import { Card, CardContent, Typography } from '@mui/material'; | ||
import HStack from './HStack'; | ||
|
||
const InfoCard = ({ icon: Icon, iconColor, text }) => { | ||
return ( | ||
<Card sx={{ ...styles.infoCard, borderColor: iconColor }}> | ||
<CardContent sx={styles.infoCardContent}> | ||
<HStack gap={1}> | ||
<Icon sx={{...styles.icon, color: iconColor}} /> | ||
<Typography variant="body2" sx={styles.infoCardText}> | ||
{text} | ||
</Typography> | ||
</HStack> | ||
</CardContent> | ||
</Card> | ||
); | ||
}; | ||
|
||
export default InfoCard; | ||
|
||
const styles = { | ||
infoCard: { | ||
borderRadius: '15px', | ||
borderStyle: 'solid', // Add this line to define the border style | ||
borderWidth: '1px', // Add this line to define the border width | ||
}, | ||
icon: { | ||
height: '20px' | ||
}, | ||
infoCardContent: { | ||
padding: "6px 8px 6px 8px", | ||
"&:last-child": { | ||
paddingBottom: '6px', | ||
}, | ||
}, | ||
infoCardText: { | ||
color: "black", | ||
fontSize: '14px', | ||
fontWeight: '400', | ||
} | ||
}; |
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