Skip to content

Fix(event-card): Tag misalignment in event card #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 39 additions & 14 deletions src/components/eventData/eventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,38 @@ const Event: React.FC<EventProps> = ({

const handleEdit = async (e: React.MouseEvent) => {
e.stopPropagation(); // Prevent event bubble up to parent
router.push(`/editEvent/${id}`);
router.push(`/editEvent/${id}`);
};


return (
<div
className="py-2 w-full mx-auto bg-white dark:bg-dark-2 rounded-lg shadow-md border border-gray-700 dark:border-gray-300 group"
<div
className="group w-full bg-white dark:bg-dark-2 rounded-lg shadow-md border border-gray-300 dark:border-gray-700 overflow-hidden hover:shadow-lg transition-shadow duration-300 cursor-pointer"
onClick={() => onEventClick(id)}
>
<div className="flex items-center justify-between pb-2 border-b border-gray-300 dark:border-gray-700">
{/* Header with Edit Button & Status */}
<div className="flex items-center justify-between px-4 py-2 border-b border-gray-300 dark:border-gray-700">
<button
onClick={handleEdit}
className="ml-3 p-2 text-gray-600 hover:text-blue-500 dark:text-gray-400 dark:hover:text-blue-300 transition-colors"
className="p-2 text-gray-600 hover:text-blue-500 dark:text-gray-400 dark:hover:text-blue-300 transition-colors"
>
<FaEdit size={18} />
</button>
<div className="flex items-center space-x-2 ml-auto pr-3">
<div className="flex items-center gap-2">
<span className="text-xs font-semibold text-green-600 bg-green-100 dark:bg-green-800 dark:text-green-300 px-2 py-1 rounded">
{eventStatus}
</span>

<span className="text-xs font-semibold text-orange-500">
{daysLeft} days left
<span className="text-xs text-orange-500">
{daysLeft>0 ? `${daysLeft} days left` : `${-daysLeft} days ago`}
</span>
</div>
</div>

<div className="p-3 relative w-full h-48 sm:h-40 md:h-52 lg:h-48 overflow-hidden group">
{/* Image Section */}
<div className="relative w-full h-48 sm:h-40 md:h-52 lg:h-48 overflow-hidden">
<Image
src={imageUrl}
alt={title}
Expand All @@ -71,18 +76,38 @@ const Event: React.FC<EventProps> = ({
/>
</div>

<div className="px-4 py-2">
<h2 className="text-lg font-bold text-gray-800 dark:text-white">
{/* Content Section */}
<div className="px-4 py-3">
<h2 className="text-lg font-bold text-gray-800 dark:text-white truncate">
{title}
</h2>
<div className="flex items-center justify-between">
<p className="flex items-center gap-1 text-sm text-gray-500 dark:text-gray-400 mt-1">
<CiLocationOn className="text-lg text-black dark:text-white font-bold" />{location}

{/* Location & Date */}
<div className="flex items-center justify-between mt-1 text-sm text-gray-500 dark:text-gray-400">
<p className="flex items-center gap-1">
<CiLocationOn className="text-lg text-black dark:text-white font-bold" />
{location}
</p>
<p className="flex items-center gap-1 text-sm text-gray-500 dark:text-gray-400 mt-1">
<FaCalendarAlt />{date}
<p className="flex items-center gap-1">
<FaCalendarAlt />
{date}
</p>
</div>


{/* Tags Section */}
<div className="flex items-center gap-2 mt-3">
<GoTag className="text-gray-600 dark:text-gray-300" />
<div className="flex flex-wrap gap-2">
{tags.map((tag, index) => (
<span
key={index}
className="text-xs font-medium bg-blue-200 text-blue-500 px-2 py-1 rounded whitespace-nowrap"
>
{tag}
</span>
))}
</div>
<div className="flex items-center flex-wrap gap-2 mt-4">
<GoTag className="font-bold" />
{tags.map((tag, index) => (
Expand Down