Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Update opp page.tsx to not dupe breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
acouch committed Sep 11, 2024
1 parent 7f0c925 commit 95d1232
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/src/app/[locale]/opportunity/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default async function OpportunityListing({
params: { id: string };
}) {
const id = Number(params.id);
const breadcrumbs = Object.assign([], OPPORTUNITY_CRUMBS);
// Opportunity id needs to be a number greater than 1
if (isNaN(id) || id < 0) {
return <NotFound />;
Expand All @@ -53,15 +54,15 @@ export default async function OpportunityListing({

const opportunityData: Opportunity = opportunity.data;

OPPORTUNITY_CRUMBS.push({
breadcrumbs.push({
title: opportunityData.opportunity_title,
path: `/opportunity/${opportunityData.opportunity_id}/`,
});

return (
<div>
<BetaAlert />
<Breadcrumbs breadcrumbList={OPPORTUNITY_CRUMBS} />
<Breadcrumbs breadcrumbList={breadcrumbs} />
<OpportunityIntro opportunityData={opportunityData} />
<GridContainer>
<div className="grid-row">
Expand Down

0 comments on commit 95d1232

Please sign in to comment.