Skip to content

Commit

Permalink
refactor: Add Exception for Reviews on Media Page
Browse files Browse the repository at this point in the history
Added conditional rendering for Reviews component based on availability of reviews nodes
  • Loading branch information
ErickLimaS committed Nov 17, 2024
1 parent 082c325 commit 6578ae9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/media/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ export default async function MediaPage({
)}

{/* REVIEWS SECTION */}
<Reviews reviews={mediaInfo.reviews.nodes} />
{mediaInfo.reviews?.nodes.length > 0 && (
<Reviews reviews={mediaInfo.reviews.nodes} />
)}

{/* RECOMMENDATIONS ACCORDING TO THIS MEDIA */}
{mediaInfo.recommendations.edges[0] && (
Expand Down

0 comments on commit 6578ae9

Please sign in to comment.