From c952829b28943f0c2cf754c6c5d608076dfd416b Mon Sep 17 00:00:00 2001 From: mohamedshamil7 Date: Sat, 16 Dec 2023 12:46:48 +0530 Subject: [PATCH 1/2] fix-#80 ui button issue solved --- frontend/src/components/latest-post-card.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/latest-post-card.tsx b/frontend/src/components/latest-post-card.tsx index dc6020ef..5bf3942f 100644 --- a/frontend/src/components/latest-post-card.tsx +++ b/frontend/src/components/latest-post-card.tsx @@ -8,6 +8,10 @@ import { createSlug } from '@/utils/slug-generator'; export default function LatestPostCard({ post }: { post: Post }) { const navigate = useNavigate(); const slug = createSlug(post.title); + const openInNewTab= (url:string):void =>{ + const newWindow = window.open(url, '_blank', 'noopener,noreferrer') + if (newWindow) newWindow.opener = null + } return (
))}
- navigate(-1)} /> + {e.stopPropagation(); openInNewTab(`/details-page/${slug}/${post._id}`)}} />
{post.title} From cfdcc8b93e98ff2fac67efb400759e6120098d7a Mon Sep 17 00:00:00 2001 From: mohamedshamil7 Date: Sat, 16 Dec 2023 22:52:45 +0530 Subject: [PATCH 2/2] fix-#80 removed navigate functionality from the button --- frontend/src/components/latest-post-card.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/frontend/src/components/latest-post-card.tsx b/frontend/src/components/latest-post-card.tsx index 5bf3942f..670563b7 100644 --- a/frontend/src/components/latest-post-card.tsx +++ b/frontend/src/components/latest-post-card.tsx @@ -8,10 +8,6 @@ import { createSlug } from '@/utils/slug-generator'; export default function LatestPostCard({ post }: { post: Post }) { const navigate = useNavigate(); const slug = createSlug(post.title); - const openInNewTab= (url:string):void =>{ - const newWindow = window.open(url, '_blank', 'noopener,noreferrer') - if (newWindow) newWindow.opener = null - } return (
))}
- {e.stopPropagation(); openInNewTab(`/details-page/${slug}/${post._id}`)}} /> +
{post.title}