From da2f6ade0a9c162ebe51155e5b38dad826944410 Mon Sep 17 00:00:00 2001 From: Serena Date: Wed, 6 Sep 2023 12:56:17 +0100 Subject: [PATCH 1/2] change twitter icon to X --- components/x-gift-article/package.json | 2 +- .../src/ShareArticleDialog.scss | 2 +- .../x-gift-article/src/SocialShareButtons.jsx | 29 +++++++------------ components/x-live-blog-post/package.json | 2 +- .../x-live-blog-post/src/ShareButtons.jsx | 2 +- .../src/__tests__/ShareButtons.test.jsx | 2 +- components/x-live-blog-post/src/svgIcons.jsx | 4 +-- .../x-live-blog-post/storybook/index.jsx | 2 +- package-lock.json | 18 ++++++------ 9 files changed, 27 insertions(+), 36 deletions(-) diff --git a/components/x-gift-article/package.json b/components/x-gift-article/package.json index fd3b1566e..5ee8253bc 100644 --- a/components/x-gift-article/package.json +++ b/components/x-gift-article/package.json @@ -48,7 +48,7 @@ "@financial-times/o-loading": "^5.2.1", "@financial-times/o-message": "^5.4.2", "@financial-times/o-normalise": "^3.2.2", - "@financial-times/o-share": "^9.0.2", + "@financial-times/o-share": "^10.0.0", "@financial-times/o-typography": "^7.4.1" } } diff --git a/components/x-gift-article/src/ShareArticleDialog.scss b/components/x-gift-article/src/ShareArticleDialog.scss index da8efe7f3..814d72c07 100644 --- a/components/x-gift-article/src/ShareArticleDialog.scss +++ b/components/x-gift-article/src/ShareArticleDialog.scss @@ -49,7 +49,7 @@ ), $types: ('action', 'alert')); @include oShare($opts: ( - 'icons': ('twitter', 'facebook', 'linkedin', 'mail', 'whatsapp') + 'icons': ('x', 'facebook', 'linkedin', 'mail', 'whatsapp') )); @include oIcons($opts: ( diff --git a/components/x-gift-article/src/SocialShareButtons.jsx b/components/x-gift-article/src/SocialShareButtons.jsx index 6b4394f5d..2e2a1a5e1 100644 --- a/components/x-gift-article/src/SocialShareButtons.jsx +++ b/components/x-gift-article/src/SocialShareButtons.jsx @@ -1,14 +1,7 @@ import { h } from '@financial-times/x-engine' import { ShareType } from './lib/constants' -export const SocialShareButtons = ({ - actions, - mailtoUrl, - shareType, - enterpriseEnabled, - url, - article -}) => { +export const SocialShareButtons = ({ actions, mailtoUrl, shareType, enterpriseEnabled, url, article }) => { const onClickHandler = (event) => { switch (shareType) { case ShareType.gift: @@ -25,19 +18,17 @@ export const SocialShareButtons = ({ } const mobileShareLinks = { - facebook: `http://www.facebook.com/sharer.php?u=${encodeURIComponent( - url - )}&t=${encodeURIComponent(article.title)}`, - twitter: `https://twitter.com/intent/tweet?url=${encodeURIComponent( - url - )}&text=${encodeURIComponent(article.title)}&via=financialtimes`, + facebook: `http://www.facebook.com/sharer.php?u=${encodeURIComponent(url)}&t=${encodeURIComponent( + article.title + )}`, + twitter: `https://twitter.com/intent/tweet?url=${encodeURIComponent(url)}&text=${encodeURIComponent( + article.title + )}&via=financialtimes`, linkedin: `http://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent( url )}&title=${encodeURIComponent(article.title)}&source=Financial+Times`, - whatsapp: `whatsapp://send?text=${encodeURIComponent(article.title)}%20-%20${encodeURIComponent( - url - )}` - }; + whatsapp: `whatsapp://send?text=${encodeURIComponent(article.title)}%20-%20${encodeURIComponent(url)}` + } return (
@@ -46,7 +37,7 @@ export const SocialShareButtons = ({