Skip to content

Commit

Permalink
fix articulos sin imagen
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignaherrero committed May 4, 2022
1 parent 689df1a commit c0ff25b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions pages/posts/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function Posts({
published,
},
}) {
const sizeImages = Object.getOwnPropertyNames(featured_media);
const sizeImages = featured_media && Object.getOwnPropertyNames(featured_media);
return (
<>
<Head>
Expand All @@ -34,15 +34,17 @@ export default function Posts({
<div className="container my-10 mx-auto">
<section className="mb-32 text-gray-800">
<div className="flex justify-center">
<Image
src={featured_media[sizeImages[5]]}
alt=""
width="921px"
height="613px"
loading="eager"
priority={true}
className="w-3/5 m-auto shadow-lg rounded-lg mb-6 object-cover"
/>
{featured_media && (
<Image
src={featured_media[sizeImages[5]]}
alt=""
width="921px"
height="613px"
loading="eager"
priority={true}
className="w-3/5 m-auto shadow-lg rounded-lg mb-6 object-cover"
/>
)}
</div>
<div className="flex items-center mb-6">
<div>
Expand Down

1 comment on commit c0ff25b

@vercel
Copy link

@vercel vercel bot commented on c0ff25b May 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

challenge-atomik – ./

challenge-atomik.vercel.app
challenge-atomik-git-main-nacho93.vercel.app
challenge-atomik-nacho93.vercel.app

Please sign in to comment.