Skip to content

Commit 0fb4792

Browse files
authored
Update card.jsx
1 parent 855ef68 commit 0fb4792

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/pages/Events/card.jsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { useState, useEffect } from "react";
22
import { Link } from "react-router-dom";
33
import PropTypes from "prop-types";
44

5-
function Card({ user }) {
5+
function Card({ events }) {
66
const [truncatedText, setTruncatedText] = useState("");
77
const maxLength = 25; // Maximum number of words
88

99
useEffect(() => {
10-
const text = user.description;
10+
const text = events.description;
1111
const words = text.split(" ");
1212

1313
if (words.length > maxLength) {
@@ -20,16 +20,16 @@ function Card({ user }) {
2020
<div className=" shadow-lg bg-zinc-600 rounded-2xl max-w-96 h-[30rem] relative">
2121
<img
2222
className="w-mag rounded-se-2xl rounded-ss-2xl"
23-
src={`${user.image}`}
24-
alt={user.alt}
23+
src={`${events.image}`}
24+
alt={events.alt}
2525
/>
2626
<div className="content-box px-4 pt-2">
27-
<p className="py-1 font-medium text-white break-words">{user.name}</p>
28-
<p className="date font-thin py-2 pr-3 text-zinc-400">{user.date}</p>
27+
<p className="py-1 font-medium text-white break-words">{events.name}</p>
28+
<p className="date font-thin py-2 pr-3 text-zinc-400">{events.date}</p>
2929
<p className="description text-white font-light ">{truncatedText}</p>
3030
</div>
3131
<Link
32-
to={user.link}
32+
to={events.link}
3333
className="absolute bottom-0 left-0 right-0 text-center tracking-widest font-thin drop-shadow-lg text-white py-7 hover:text-red-600"
3434
>
3535
READ MORE
@@ -38,7 +38,7 @@ function Card({ user }) {
3838
);
3939
}
4040
Card.propTypes = {
41-
user: PropTypes.isRequired,
41+
events: PropTypes.isRequired,
4242
};
4343

4444
export default Card;

0 commit comments

Comments
 (0)