Newer
Older

Fin Wallis
committed
import React from "react";

Fin Wallis
committed
import Paper from "@mui/material/Paper";
import Card from "@mui/material/Card";
import Grid from "@mui/material/Grid";
import CardActions from "@mui/material/CardActions";
import CardContent from "@mui/material/CardContent";
import CardMedia from "@mui/material/CardMedia";
import Button from "@mui/material/Button";
import Typography from "@mui/material/Typography";
// Event card - Using material UI framework to bootstrap this process

Fin Wallis
committed
const EventCard = ({ eventData, size }) => {
console.log(Object.values(eventData));
return (
<>
{/* Small marketplace card */}
{size === "small" && (
<Card>

Fin Wallis
committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<CardMedia
component="img"
sx={{ maxHeight: 140 }}
height={140}
image={eventData.eventImage}
alt="Event Image"
/>
<CardContent>
<div style={{ overflow: "hidden", textOverflow: "ellipsis" }}>
<Typography gutterBottom variant="h5" noWrap component="div">
{eventData.eventTitle}
</Typography>
</div>
{/* Adding text elipsis to add ... automatically */}
<div
style={{
overflow: "hidden",
textOverflow: "ellipsis",
height: 70,
}}
>
<Typography variant="body2" color="text.secondary">
{eventData.eventDescription}
</Typography>
</div>
</CardContent>
<CardActions>
<Button size="small">Learn More</Button>
</CardActions>
</Card>
)}
{/* Large marketplace using paper instead */}
{size === "large" && (
<Paper>
<Grid container>
<Grid item xs={6}>
<CardMedia
component="img"

Fin Wallis
committed
sx={{ maxHeight: 140 }}
height={140}
image={eventData.eventImage}
alt="Event Image"

Fin Wallis
committed
/>
</Grid>
</Grid>
</Paper>
)}
</>
);
};

Fin Wallis
committed
export default EventCard;