Styling refactor
This commit is contained in:
@@ -3,22 +3,22 @@ import { getStatusClass } from "@/components/petUtils";
|
||||
|
||||
export default function PetCard({petId, petName, petSpecies, petStatus, imageUrl}) {
|
||||
return (
|
||||
<Link href={`/adopt/${petId}`} className="pet-card">
|
||||
<div className="pet-card-image-wrapper">
|
||||
<Link href={`/adopt/${petId}`} className="no-underline text-inherit flex flex-col rounded-2xl overflow-hidden shadow-[0_4px_12px_rgba(0,0,0,0.08)] transition-all duration-300 hover:-translate-y-1.5 hover:shadow-[0_8px_24px_rgba(0,0,0,0.13)] bg-white">
|
||||
<div className="bg-[#fff8ee] flex items-center justify-center aspect-square">
|
||||
<img
|
||||
src={imageUrl || "/images/pet-placeholder.png"}
|
||||
alt={petName}
|
||||
className="pet-card-image"
|
||||
className="w-full h-full object-cover"
|
||||
onError={(e) => {
|
||||
e.currentTarget.onerror = null;
|
||||
e.currentTarget.src = "/images/pet-placeholder.png";
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="pet-card-body">
|
||||
<h3 className="pet-card-name">{petName}</h3>
|
||||
<p className="pet-card-species">{petSpecies}</p>
|
||||
<span className={`pet-card-status ${getStatusClass(petStatus)}`}>
|
||||
<div className="px-3 pt-[0.6rem] pb-3 flex flex-col gap-[0.2rem]">
|
||||
<h3 className="text-[0.95rem] font-bold text-[#222] m-0 truncate">{petName}</h3>
|
||||
<p className="text-[0.8rem] text-[#666] m-0">{petSpecies}</p>
|
||||
<span className={`inline-block mt-[0.2rem] px-2 py-[0.15rem] rounded-full text-[0.7rem] font-semibold capitalize w-fit ${getStatusClass(petStatus)}`}>
|
||||
{petStatus}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user