Skip to content

Commit

Permalink
feat: add dynamic className props to picture common component
Browse files Browse the repository at this point in the history
  • Loading branch information
moonbamijam committed May 1, 2024
1 parent 6b3b60f commit f01ac60
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/common/Picture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ type Props = {
src: string | Url;
alt: string;
isPriority?: boolean;
className?: string;
};

export default function Picture({ src, alt, isPriority }: Props) {
export default function Picture({ src, alt, isPriority, className }: Props) {
return (
<CldImage
priority={isPriority}
src={`https://res.cloudinary.com/${process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME}/image/upload/v1710343815/portfolio/${src}`}
fill
sizes="(min-width: 475px) 100vw, (min-width: 768px) 1080px, (min-width: 1024px) 1920px"
alt={`${alt}`}
className="object-cover"
className={`object-cover ${className}`}
/>
);
}

0 comments on commit f01ac60

Please sign in to comment.