Skip to content

Commit 00131e2

Browse files
committed
style: covering images
1 parent ce67f43 commit 00131e2

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

app/src/components/DirectusImage.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ export default function DirectusImage({
1313
img,
1414
name,
1515
className,
16+
cover,
1617
}: {
1718
img?: string | components["schemas"]["Files"] | null;
1819
name?: string;
1920
className?: string;
21+
cover?: boolean;
2022
}) {
2123
if (img) {
2224
return (
@@ -25,7 +27,7 @@ export default function DirectusImage({
2527
loader={imageLoader}
2628
src={typeof img === "string" ? img : img.filename_disk || ""}
2729
fill
28-
style={{ objectFit: "contain" }}
30+
style={{ objectFit: cover ? "cover" : "contain" }}
2931
alt={name || "image"}
3032
/>
3133
</div>

app/src/components/NewsCard.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default function NewsCard({ news }: { news: News }) {
1515
img={translation.banner}
1616
name={translation.title || ""}
1717
className={styles.picture}
18+
cover={true}
1819
/>
1920

2021
<div>

app/src/styles/globals.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ a {
3030

3131
.CLICLogo {
3232
width: 100%;
33-
height: 30rem;
33+
height: 15rem;
3434
fill: white;
3535
margin: auto;
3636
margin-top: 30vh;

0 commit comments

Comments
 (0)