From 094a7a075f089063622eb00d5fbbca15ba45fc0b Mon Sep 17 00:00:00 2001 From: ibrahim-mamdouh-ft Date: Wed, 16 Oct 2024 13:26:15 +0300 Subject: [PATCH 1/3] WIP: share highlight preview when copying a link --- components/x-gift-article/src/UrlSection.jsx | 28 +++++++++++++++++-- .../src/lib/share-link-actions.js | 2 +- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/components/x-gift-article/src/UrlSection.jsx b/components/x-gift-article/src/UrlSection.jsx index 48c1346da..7e8a334e0 100644 --- a/components/x-gift-article/src/UrlSection.jsx +++ b/components/x-gift-article/src/UrlSection.jsx @@ -1,10 +1,21 @@ import { h } from '@financial-times/x-engine' +import { trimHighlights } from './lib/highlightsHelpers' import CopyConfirmation from './CopyConfirmation' import { ShareType } from './lib/constants' import { SocialShareButtons } from './SocialShareButtons' export const UrlSection = (props) => { - const { urlType, url, actions, shareType, showCopyConfirmation, enterpriseEnabled } = props + const { + urlType, + url, + actions, + shareType, + showCopyConfirmation, + enterpriseEnabled, + includeHighlights, + article, + highlight + } = props const copyLinkHandler = (event) => { switch (shareType) { @@ -28,7 +39,18 @@ export const UrlSection = (props) => { data-section-id={shareType + 'Link'} data-trackable="copy-link" > - + {includeHighlights ? ( +