Skip to content

Commit

Permalink
correctly pass urlPath to FeedItem, rather than using liveUrl sin…
Browse files Browse the repository at this point in the history
…ce that is prefixed by hostname etc.
  • Loading branch information
twrichards committed Oct 22, 2024
1 parent ec715c0 commit 4f28e0a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions fronts-client/src/components/feed/ArticleFeedItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const ArticleFeedItemComponent = ({
type={CardTypesMap.ARTICLE}
id={article.id}
title={article.webTitle}
urlPath={article.urlPath}
liveUrl={getPaths(article.id).live}
thumbnail={getThumbnail(article.frontsMeta.defaults, article)}
scheduledPublicationDate={article.fields.scheduledPublicationDate}
Expand Down
1 change: 1 addition & 0 deletions fronts-client/src/components/feed/ChefFeedItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const ChefFeedItemComponent = ({
title={chef.internalName}
hasVideo={false}
isLive={true}
urlPath={chef.apiUrl}
liveUrl={`https://theguardian.com/${chef.apiUrl}`}
thumbnail={chef.bylineLargeImageUrl}
onAddToClipboard={onAddToClipboard}
Expand Down
4 changes: 3 additions & 1 deletion fronts-client/src/components/feed/FeedItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ interface FeedItemProps {
id: string;
type: CardTypes;
title: string;
urlPath: string;
liveUrl?: string;
metaContent?: JSX.Element;
scheduledPublicationDate?: string;
Expand Down Expand Up @@ -138,6 +139,7 @@ export class FeedItem extends React.Component<FeedItemProps, {}> {
id,
type,
title,
urlPath,
liveUrl,
isLive,
metaContent,
Expand Down Expand Up @@ -220,7 +222,7 @@ export class FeedItem extends React.Component<FeedItemProps, {}> {
<HoverActionsButtonWrapper
toolTipPosition={'top'}
toolTipAlign={'right'}
urlPath={liveUrl}
urlPath={urlPath}
renderButtons={(props) => (
<>
<HoverViewButton hoverText="View" href={href} {...props} />
Expand Down
1 change: 1 addition & 0 deletions fronts-client/src/components/feed/RecipeFeedItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const RecipeFeedItem = ({ id }: ComponentProps) => {
id={recipe.canonicalArticle}
title={recipe.title}
thumbnail={recipe.previewImage?.url ?? recipe.featuredImage?.url ?? ''}
urlPath={recipe.canonicalArticle}
liveUrl={`https://theguardian.com/${recipe.canonicalArticle}`}
hasVideo={false}
isLive={true} // We do not yet serve preview recipes
Expand Down

0 comments on commit 4f28e0a

Please sign in to comment.