Skip to content

Commit

Permalink
Merge pull request #504 from AKSHITHA-CHILUKA/patch-10
Browse files Browse the repository at this point in the history
Create EventCard.jsx
  • Loading branch information
hustlerZzZ authored Aug 8, 2024
2 parents f72f059 + 5508e6f commit 64ba0fe
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/components/EventCard.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// src/components/EventCard.jsx
import React from 'react';
import './EventCard.css'; // Optional: for styling
const EventCard = ({ event }) => {
const { title, date, description, imageUrl } = event;
return (
<div className="event-card">
{imageUrl && (
<img src={imageUrl} alt={title} className="event-image" />
)}
<div className="event-content">
<h2 className="event-title">{title}</h2>
<p className="event-date">{new Date(date).toLocaleDateString()}</p>
<p className="event-description">{description}</p>
</div>
</div>
);
};
export default EventCard;

0 comments on commit 64ba0fe

Please sign in to comment.