diff --git a/workspaces/website/src/pages/content/@slug/SocialShare/SocialShare.tsx b/workspaces/website/src/pages/content/@slug/SocialShare/SocialShare.tsx index 9f5703c368..0b94619cfa 100644 --- a/workspaces/website/src/pages/content/@slug/SocialShare/SocialShare.tsx +++ b/workspaces/website/src/pages/content/@slug/SocialShare/SocialShare.tsx @@ -1,9 +1,5 @@ import { Flex, Icon, Text } from "@chakra-ui/react"; -import { - LinkedinShareButton, - TwitterShareButton, - TelegramShareButton, -} from "react-share"; +import { TwitterShareButton, TelegramShareButton } from "react-share"; import { FaTelegram } from "react-icons/fa"; import { FaTwitter } from "react-icons/fa"; import { FaLinkedin } from "react-icons/fa"; @@ -13,8 +9,13 @@ interface Props { readonly slug: string; }; } + const SocialShare = ({ params: { slug, locale } }: Props) => { const shareUrl = `${import.meta.env.VITE_SITE_URL}${locale}/content/${slug}`; + const encodedUrl = encodeURIComponent(shareUrl); + const linkedinShareUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${encodedUrl}`; + const handleLinkedinShare = () => window.open(linkedinShareUrl, "_blank"); + return ( { { - - - + );