Skip to content

Commit

Permalink
fix share link
Browse files Browse the repository at this point in the history
  • Loading branch information
yousefomar724 committed Jun 26, 2022
1 parent 12c9858 commit c06522d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pages/post/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ const SinglePostPage = ({ post, financialPosts }) => {
setDate(format(new Date(), "eeee dd/MM/yyyy - hh:mm ", { locale: ar }));
}; */

let currentURL
useEffect(() => {
currentURL = window.location.href
})
// let currentURL
// useEffect(() => {
// currentURL = window.location.href
// })

const {
i18n: { language },
Expand Down Expand Up @@ -168,7 +168,7 @@ const SinglePostPage = ({ post, financialPosts }) => {

<div className='sharePostIconsDiv'>
<FacebookMessengerShareButton
url={currentURL}
url={typeof window !== undefined && window.location.href}
className='sharePostliIcon'
>
<img
Expand All @@ -180,7 +180,7 @@ const SinglePostPage = ({ post, financialPosts }) => {

<TelegramShareButton
title={post?.post_title.trim()}
url={currentURL}
url={typeof window !== undefined && window.location.href}
className='sharePostliIcon'
>
<img
Expand All @@ -192,7 +192,7 @@ const SinglePostPage = ({ post, financialPosts }) => {

<WhatsappShareButton
title={post?.post_title.trim()}
url={currentURL}
url={typeof window !== undefined && window.location.href}
className='sharePostliIcon'
>
<img
Expand All @@ -204,7 +204,7 @@ const SinglePostPage = ({ post, financialPosts }) => {

<TwitterShareButton
title={post?.post_title.trim()}
url={currentURL}
url={typeof window !== undefined && window.location.href}
className='sharePostliIcon'
>
<img
Expand All @@ -215,7 +215,7 @@ const SinglePostPage = ({ post, financialPosts }) => {
</TwitterShareButton>

<FacebookShareButton
url={currentURL}
url={typeof window !== undefined && window.location.href}
quote={post?.post_title.trim()}
className='sharePostliIcon'
>
Expand Down

1 comment on commit c06522d

@vercel
Copy link

@vercel vercel bot commented on c06522d Jun 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.