From c6014ddb864b844d0de4919204b39bac9ddc670f Mon Sep 17 00:00:00 2001 From: qi_xing_jk Date: Mon, 4 Mar 2024 21:12:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=A2=9E=E5=BC=BA=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=9A=84tags=E5=8A=9F=E8=83=BD):=20=E7=BB=99?= =?UTF-8?q?Facebook/Twitter/Tumblr=E5=92=8CWorkplace=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E6=8C=89=E9=92=AE=E7=9A=84tags=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 1cde3dd8b9cfd2bc781ea03efb542e5f9132a1f8) --- components/ShareButtons.js | 90 ++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 42 deletions(-) diff --git a/components/ShareButtons.js b/components/ShareButtons.js index 5ea54055..5ad3bae5 100644 --- a/components/ShareButtons.js +++ b/components/ShareButtons.js @@ -5,48 +5,48 @@ import { useRouter } from 'next/router' import { useEffect, useState } from 'react' import { - EmailIcon, - EmailShareButton, - FacebookIcon, - FacebookMessengerIcon, - FacebookMessengerShareButton, - FacebookShareButton, - HatenaIcon, - HatenaShareButton, - InstapaperIcon, - InstapaperShareButton, - LineIcon, - LineShareButton, - LinkedinIcon, - LinkedinShareButton, - LivejournalIcon, - LivejournalShareButton, - MailruIcon, - MailruShareButton, - OKIcon, - OKShareButton, - PinterestIcon, - PinterestShareButton, - PocketIcon, - PocketShareButton, - RedditIcon, - RedditShareButton, - TelegramIcon, - TelegramShareButton, - TumblrIcon, - TumblrShareButton, - TwitterIcon, - TwitterShareButton, - VKIcon, - VKShareButton, - ViberIcon, - ViberShareButton, - WeiboIcon, - WeiboShareButton, - WhatsappIcon, - WhatsappShareButton, - WorkplaceIcon, - WorkplaceShareButton + EmailIcon, + EmailShareButton, + FacebookIcon, + FacebookMessengerIcon, + FacebookMessengerShareButton, + FacebookShareButton, + HatenaIcon, + HatenaShareButton, + InstapaperIcon, + InstapaperShareButton, + LineIcon, + LineShareButton, + LinkedinIcon, + LinkedinShareButton, + LivejournalIcon, + LivejournalShareButton, + MailruIcon, + MailruShareButton, + OKIcon, + OKShareButton, + PinterestIcon, + PinterestShareButton, + PocketIcon, + PocketShareButton, + RedditIcon, + RedditShareButton, + TelegramIcon, + TelegramShareButton, + TumblrIcon, + TumblrShareButton, + TwitterIcon, + TwitterShareButton, + ViberIcon, + ViberShareButton, + VKIcon, + VKShareButton, + WeiboIcon, + WeiboShareButton, + WhatsappIcon, + WhatsappShareButton, + WorkplaceIcon, + WorkplaceShareButton } from 'react-share' const QrCode = dynamic(() => import('@/components/QrCode'), { ssr: false }) @@ -61,6 +61,8 @@ const ShareButtons = ({ post }) => { const [shareUrl, setShareUrl] = useState(siteConfig('LINK') + router.asPath) const title = post?.title || siteConfig('TITLE') const image = post?.pageCover + const tags = post.tags || [] + const hashTags = tags.map(tag => `#${tag}`).join(',') const body = post?.title + ' | ' + title + ' ' + shareUrl + ' ' + post?.summary @@ -95,6 +97,7 @@ const ShareButtons = ({ post }) => { @@ -152,6 +155,7 @@ const ShareButtons = ({ post }) => { key={singleService} url={shareUrl} title={titleWithSiteInfo} + hashtags={tags} className='mx-1'> @@ -229,6 +233,7 @@ const ShareButtons = ({ post }) => { key={singleService} url={shareUrl} title={titleWithSiteInfo} + tags={tags} className='mx-1'> @@ -274,6 +279,7 @@ const ShareButtons = ({ post }) => { key={singleService} url={shareUrl} quote={titleWithSiteInfo} + hashtag={hashTags} className='mx-1'>