Set images to object contain

This commit is contained in:
James Grugett 2022-04-25 23:22:49 -04:00
parent 5ca8c9a705
commit 902f165aec
2 changed files with 8 additions and 2 deletions

View File

@ -14,7 +14,7 @@ export function CharityCard(props: { charity: Charity }) {
<Link href={`/charity/${slug}`} passHref> <Link href={`/charity/${slug}`} passHref>
<div className="card image-full bg-base-100 glass cursor-pointer shadow-xl"> <div className="card image-full bg-base-100 glass cursor-pointer shadow-xl">
<figure className="absolute h-full"> <figure className="absolute h-full">
{photo && <img src={photo} alt="" />} {photo && <img className="!object-contain" src={photo} alt="" />}
</figure> </figure>
<div className="card-body"> <div className="card-body">
<h3 className="card-title line-clamp-3">{name}</h3> <h3 className="card-title line-clamp-3">{name}</h3>

View File

@ -53,7 +53,13 @@ function CharityPage(props: { charity: Charity }) {
<Title className="!mt-0" text={name} /> <Title className="!mt-0" text={name} />
{/* TODO: donations over time chart */} {/* TODO: donations over time chart */}
<Row className="justify-between"> <Row className="justify-between">
{photo && <img src={photo} alt="" className="w-40 rounded-2xl" />} {photo && (
<img
src={photo}
alt=""
className="w-40 rounded-2xl object-contain"
/>
)}
<Details <Details
charity={charity} charity={charity}
totalRaised={totalRaised} totalRaised={totalRaised}