Skip to content

Commit

Permalink
build failing - try putting nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
GraemeFulton committed Feb 10, 2024
1 parent 7b83c12 commit 8205ce3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions components/v4/card/SmallCard/MediumPost.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ const MediumPost = ({link, title, image, tags, date, avatar, author, excerpt, im
//2 long tags make break the layout, so remove word 'design'
let name = tag.attributes?.name.replace('-', ' ')
return (
<SmallTag
<>
{tag?.attributes?.slug?<SmallTag
key={index}
index={index}
link={`/posts/${tag.attributes?.slug}/page/1/`}
>
{name}
</SmallTag>
</SmallTag>:null}
</>
);
})
: ""}
Expand Down
10 changes: 5 additions & 5 deletions components/v4/layout/PostsGroup3Cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ const PostsGroup3Cards = ({posts,cols}) =>{
{/* <PrototyprNetworkCTA2 /> */}
{posts?.length ? (
posts.map((post, index) => {
let url = post?.attributes?.featuredImage?.data?.attributes?.url?post?.attributes?.featuredImage?.data?.attributes?.url:null;
let url = post?.attributes?.featuredImage?.data?.attributes?.url? post?.attributes?.featuredImage?.data?.attributes?.url:null;
const coverImage = url
? url
: post?.attributes?.legacyFeaturedImage?.mediaItemUrl?post?.attributes?.legacyFeaturedImage?.mediaItemUrl:null;
let authorData = post.attributes?.author?.data?.attributes?post.attributes?.author?.data?.attributes:null
let avatar = authorData?.avatar?.data?authorData?.avatar?.data?.attributes?.url:authorData?.legacyAvatar?authorData?.legacyAvatar:dummyAvatar
: post?.attributes?.legacyFeaturedImage?.mediaItemUrl? post?.attributes?.legacyFeaturedImage?.mediaItemUrl:null;
let authorData = post.attributes?.author?.data?.attributes? post.attributes?.author?.data?.attributes:null
let avatar = authorData?.avatar?.data? authorData?.avatar?.data?.attributes?.url: authorData?.legacyAvatar?authorData?.legacyAvatar:dummyAvatar
return (
<div key={index} className="w-full">
<MediumPost
imageSmall={cols==4?true:''}
link={`/post/${post?.attributes?.slug}`}
link={`/post/${post?.attributes?.slug?post?.attributes?.slug:''}`}
avatar={avatar}
author={post?.attributes?.author?.data?.attributes?post?.attributes?.author?.data?.attributes:null}
image={coverImage}
Expand Down
2 changes: 1 addition & 1 deletion pages/api/og.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ImageResponse } from '@vercel/og';
import { NextRequest } from 'next/server';

export const config = {
runtime: 'experimental-edge',
runtime: 'edge',
};

const OgImageHandler = async (req)=> {
Expand Down

0 comments on commit 8205ce3

Please sign in to comment.