Skip to content

Commit 9f8185f

Browse files
committed
update Law and Justice logo and fix sector detail page
1 parent f36f5d6 commit 9f8185f

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

app/[locale]/(user)/components/ListingComponent.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ const ListingComponent: React.FC<ListingProps> = ({
204204
categoryDescription,
205205
categoryImage,
206206
}) => {
207+
console.log(categoryName);
208+
207209
const [facets, setFacets] = useState<{
208210
results: any[];
209211
total: number;

app/[locale]/(user)/sectors/[sectorSlug]/page.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,28 @@ const sectorQueryDoc = graphql(`
1717
name
1818
description
1919
datasetCount
20+
slug
2021
}
2122
}
2223
`);
2324

24-
const SectorDetailsPage = ({
25-
params,
26-
}: {
27-
params: { categorySlug: string };
28-
}) => {
25+
const SectorDetailsPage = ({ params }: { params: { sectorSlug: string } }) => {
2926
const { data, isLoading, isError } = useQuery(
30-
[`get_category_details_${params.categorySlug}`],
31-
() =>
32-
GraphQL(sectorQueryDoc, {}, { filters: { slug: params.categorySlug } })
27+
[`get_category_details_${params.sectorSlug}`],
28+
() => GraphQL(sectorQueryDoc, {}, { filters: { slug: params.sectorSlug } })
3329
);
3430

3531
if (isError) return <ErrorPage />;
3632
if (isLoading) return <Loading />;
3733

38-
const sector = data?.sectors[0];
34+
const sector = data?.sectors.filter(
35+
(item) => item.slug === params.sectorSlug
36+
)[0];
3937

4038
const breadcrumbData = [
4139
{ href: '/', label: 'Home' },
4240
{ href: '/sectors', label: 'Sectors' },
43-
{ href: '#', label: sector?.name || params.categorySlug },
41+
{ href: '#', label: sector?.name || params.sectorSlug },
4442
];
4543

4644
return (
@@ -50,7 +48,6 @@ const SectorDetailsPage = ({
5048
categoryName={sector?.name}
5149
categoryDescription={sector?.description ?? undefined}
5250
categoryImage={`/Sectors/${sector.name}.svg`}
53-
5451
/>
5552
);
5653
};

0 commit comments

Comments
 (0)