Skip to content

Commit 3c58178

Browse files
committed
fix(reports): updated reports card images and images in reports to use next js image component
1 parent ab56d2f commit 3c58178

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

app/reports/[slug]/page.tsx

+9-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import type { Report } from "@/types";
1111
import parse from "html-react-parser";
1212
import { ChevronLeft, MapPin } from "lucide-react";
1313
import type { Metadata } from "next";
14+
import Image from "next/image";
1415
import Link from "next/link";
1516

1617
interface ReportPageProps {
@@ -114,11 +115,14 @@ export default async function ReportPage({ params }: ReportPageProps) {
114115
<h3 className="font-bold text-2xl pb-3">Summary</h3>
115116
<p className="text-wrap leading-relaxed">{report.summary}</p>
116117
</div>
117-
<img
118-
src={report.image}
119-
alt="Report illustration"
120-
className="rounded-2xl md:h-[420px] md:object-cover md:w-full"
121-
/>
118+
<div className="relative rounded-2xl md:h-[420px] h-[358px] w-full overflow-hidden">
119+
<Image
120+
src={report.image}
121+
alt="Report illustration"
122+
className="-z-10 object-cover bg-center"
123+
fill
124+
/>
125+
</div>
122126
{htmlParsedStory && (
123127
<article className="prose text-vd-blue-900">
124128
{htmlParsedStory}

components/reports/reports-view.tsx

+9-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
} from "@/lib/search-filter-utils";
1313
import type { ISortingOption, Report } from "@/types";
1414
import Fuse from "fuse.js";
15+
import Image from "next/image";
1516
import { useCallback, useMemo, useState } from "react";
1617
import { ShowingDisplay, VDPaginator } from "../global/vd-paginator";
1718
import { SidebarFilter } from "./filter-sidebar";
@@ -130,11 +131,14 @@ export function ReportsView({ reports }: IPageData) {
130131
) : (
131132
<section className="w-full flex justify-center items-center py-6">
132133
<div className="flex flex-col items-center text-center pb-24 md:pb-10">
133-
<img
134-
className="h-20 w-20"
135-
src="/reports_not_found.svg"
136-
alt="flower illustration"
137-
/>
134+
<div className="h-20 w-20">
135+
<Image
136+
src="/reports_not_found.svg"
137+
alt="flower illustration"
138+
height={20}
139+
width={20}
140+
/>
141+
</div>
138142
<p className="text-lg font-bold text-vd-beige-600">
139143
We couldn't find any reports matching your search or filter.
140144
</p>

0 commit comments

Comments
 (0)