diff --git a/src/pages/recipes/Recipes.tsx b/src/pages/recipes/Recipes.tsx index 5223451..d9a7086 100644 --- a/src/pages/recipes/Recipes.tsx +++ b/src/pages/recipes/Recipes.tsx @@ -38,7 +38,8 @@ const Recipes = () => { recipeInfoView.mainImage.owner.username, recipeInfoView.mainImage.filename ], - queryFn: async ({ signal }) => { + queryFn: async ({ signal }: any) => { + // any needed in the params const imgUrl = await getImage({ accessToken: token, signal, @@ -78,20 +79,11 @@ const Recipes = () => { ownerUsername={view.ownerUsername} slug={view.slug} mainImageUrl={ - slugsAndImgUrls.find( - ({ data: slugAndImgUrl }) => { - return ( - slugAndImgUrl !== undefined && - slugAndImgUrl.slug === view.slug - ) - } - )?.data!.imgUrl ?? '' // hacky workaround. should pass a kind of child which loads its own data - } - mainImageAlt={ - view.mainImage.alt - ? view.mainImage.alt - : undefined + slugsAndImgUrls.find(({ data: slugAndImgUrl }) => { + return slugAndImgUrl !== undefined && slugAndImgUrl.slug === view.slug + })?.data!.imgUrl ?? '' // hacky workaround. should pass a kind of child which loads its own data } + mainImageAlt={view.mainImage.alt ? view.mainImage.alt : undefined} starCount={view.starCount} isPublic={view.isPublic} />