Skip to content

Commit

Permalink
WSTEAM1-1514: Update
Browse files Browse the repository at this point in the history
  • Loading branch information
shayneahchoon committed Feb 3, 2025
1 parent 1e894cf commit 975419f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/app/components/MostRead/Canonical/Item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,21 @@ export const MostReadLink = ({
eventTrackingData,
}: PropsWithChildren<MostReadLinkProps>) => {
const { isLite } = useContext(RequestContext);
const clickTrackerHandler = useClickTrackerHandler(eventTrackingData);
const liteUrl = useConstructLiteSiteUrl(eventTrackingData);

const clickTrackerHandler = isLite
? {
[LITE_TRACKER_PARAM]: useConstructLiteSiteUrl(eventTrackingData),

Check failure on line 57 in src/app/components/MostRead/Canonical/Item/index.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

React Hook "useConstructLiteSiteUrl" is called conditionally. React Hooks must be called in the exact same order in every component render
}
: {
onClick: useClickTrackerHandler(eventTrackingData),

Check failure on line 60 in src/app/components/MostRead/Canonical/Item/index.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

React Hook "useClickTrackerHandler" is called conditionally. React Hooks must be called in the exact same order in every component render
};

return (
<div css={getItemCss({ dir, size })} dir={dir}>
<a
css={[styles.link, size === 'default' && styles.defaultLink]}
href={href}
onClick={clickTrackerHandler}
{...(isLite && { [LITE_TRACKER_PARAM]: liteUrl })}
{...clickTrackerHandler}
>
{title}
</a>
Expand Down

0 comments on commit 975419f

Please sign in to comment.