Skip to content

Commit

Permalink
Merge pull request #411 from nishant0708/updated=Canteen-card
Browse files Browse the repository at this point in the history
Feat:Want to Update Canteen Cards #398
  • Loading branch information
hustlerZzZ authored Jul 7, 2024
2 parents 6ca4a81 + 3d3adf1 commit 14a9103
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions src/components/CanteenCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,32 @@ const CanteenCard = ({ canteen }) => {
}));
};

const truncatedName = canteen.name.length > 14 ? canteen.name.substring(0, 14) + "..." : canteen.name;

return (
<div className="max-w-(18rem) bg-white border border-white rounded-lg shadow dark:bg-none dark:border-white my-4 mx-2 transition duration-300 ease-in-out transform hover:scale-105 hover:shadow-lg hover:shadow-green-500/50 ...">
<div className="sm:w-64 w-[80vw] px-5 bg-white flex flex-col border pt-5 h-[320px] border-white rounded-lg shadow dark:bg-none dark:border-white my-4 mx-2 transition duration-300 ease-in-out transform hover:scale-105 hover:shadow-lg hover:shadow-green-500/50 ... md:justify-center h-[380px]">
{loading ? (
<div className="flex justify-center items-center h-48 w-full">
<ClipLoader size={50} color={"#123abc"} loading={loading} />
</div>
) : (
<div className="flex justify-center">
<a href="#">
<img
<div className=""><img
className="rounded-t-lg h-48 w-full object-cover"
src={canteen.canteenImage ? canteen.canteenImage : imageSrc}
alt={canteen.name}
/>
/></div>
</a>
</div>
)}
<div className="p-5">
<a href="#">
<h5 className="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-gray-900 hover:text-green-500 transition duration-300 ease-in-out overflow-x-hidden">
{canteen.name}
{truncatedName}
</h5>
</a>

<Link
to={`/menu/${canteen._id}`}
className="inline-flex items-center px-3 py-2 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 transition duration-300 ease-in-out"
Expand All @@ -80,4 +82,4 @@ const CanteenCard = ({ canteen }) => {
);
};

export default CanteenCard;
export default CanteenCard;
4 changes: 2 additions & 2 deletions src/components/CanteenList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ const CanteenList = ({ canteenData }) => {
}

return (
<div className="flex flex-wrap justify-center mt-20">
<div className="flex flex-wrap lg:px-28 gap-5 justify-center mt-20">
{canteenData.data.map((canteen) => (
<CanteenCard key={canteen._id} canteen={canteen} />
))}
</div>
);
};

export default CanteenList;
export default CanteenList;

0 comments on commit 14a9103

Please sign in to comment.