From b3592ea6544023782bd0d338acc9192202061265 Mon Sep 17 00:00:00 2001 From: barbara-chaves Date: Thu, 14 Dec 2023 17:32:43 +0100 Subject: [PATCH] Update story --- client/src/containers/home/top-stories/item.tsx | 4 +++- client/src/containers/home/top-stories/mockup.json | 14 +++++--------- .../containers/story/steps/layouts/outro-step.tsx | 10 +++------- client/src/lib/image-src/index.ts | 6 ++++++ 4 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 client/src/lib/image-src/index.ts diff --git a/client/src/containers/home/top-stories/item.tsx b/client/src/containers/home/top-stories/item.tsx index 12f51a4..c22cb9f 100644 --- a/client/src/containers/home/top-stories/item.tsx +++ b/client/src/containers/home/top-stories/item.tsx @@ -22,12 +22,14 @@ const TopStoriesItem = ({ story }: TopStoriesItemProps) => { } }; + const src = story?.image; + return (
{story.title} {
{d.logos && d.logos?.data?.map((logo, index) => { - const src = - env.NEXT_PUBLIC_ENVIRONMENT === 'development' - ? `${env.NEXT_PUBLIC_API_URL.replace('/api', '')}${ - logo?.attributes?.url - }` - : logo?.attributes?.url || ''; + const src = getImageSrc(logo?.attributes?.url); + const url = links[i][index]; return url ? ( + env.NEXT_PUBLIC_ENVIRONMENT === 'development' + ? `${env.NEXT_PUBLIC_API_URL.replace('/api', '')}${url}` + : url || '';