Skip to content

Commit

Permalink
fix: image sizings
Browse files Browse the repository at this point in the history
  • Loading branch information
SidonieBouthors committed Jul 18, 2024
1 parent a294880 commit 4480e76
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function About() {
Thank you for visiting!
</p>
</div>
<ExportedImage
<img
className="about-portrait"
src={portrait.src}
alt="author portrait"
Expand All @@ -72,8 +72,10 @@ export default function About() {
>
<ExportedImage
className="about-snippet-icon"
src={snippet.icon?.src}
src={snippet.icon!.src}
alt={snippet.title ? snippet.title : ""}
width={snippet.icon!.width}
height={snippet.icon!.height}
/>
</Link>
) : (
Expand All @@ -84,6 +86,8 @@ export default function About() {
className="about-snippet-icon"
src={snippet.icon!.src}
alt={snippet.title ? snippet.title : ""}
width={snippet.icon!.width}
height={snippet.icon!.height}
/>
) : (
<Fragment />
Expand Down
6 changes: 5 additions & 1 deletion components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ interface CardProps {
export default function Card({ slug, title, imageUrl }: CardProps) {
return (
<figure className="rec-card">
<ExportedImage src={imageUrl} alt={title} />
<ExportedImage
src={imageUrl}
width={500}
height={500}
alt={title} />
<figcaption className="rec-desc">
<p className="rec-name">{title}</p>
<Link href={slug} className="rec-button">
Expand Down
1 change: 1 addition & 0 deletions styles/layout/_recipe-card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

img {
display: block;
width: 100%;
}

.rec-desc {
Expand Down
2 changes: 2 additions & 0 deletions styles/pages/_about.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
.about-snippet-icon {
max-width: max(60%, 12em);
max-height: 4em;
width: auto;
height: auto;
pointer-events: visible;
}
}
Expand Down

0 comments on commit 4480e76

Please sign in to comment.