From 348a887e4fa5e087142c8bec29f65f7ceb081550 Mon Sep 17 00:00:00 2001 From: Oleg Proskurin Date: Wed, 21 Jan 2026 20:43:14 +0700 Subject: [PATCH] fix: social buttons --- .../app/(landings)/blog/_components/BlogShareButtons.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/landing/src/app/(landings)/blog/_components/BlogShareButtons.tsx b/apps/landing/src/app/(landings)/blog/_components/BlogShareButtons.tsx index 000ef13..db28c7a 100644 --- a/apps/landing/src/app/(landings)/blog/_components/BlogShareButtons.tsx +++ b/apps/landing/src/app/(landings)/blog/_components/BlogShareButtons.tsx @@ -8,7 +8,14 @@ interface BlogShareButtonsProps { } export const BlogShareButtons = ({ url, title }: BlogShareButtonsProps) => { - const shareUrl = url || (typeof window !== 'undefined' ? window.location.href : ''); + // Build full URL from relative path + const getFullUrl = () => { + if (typeof window === 'undefined') return url || ''; + if (url?.startsWith('http')) return url; + return `${window.location.origin}${url || window.location.pathname}`; + }; + + const shareUrl = getFullUrl(); const shareTitle = title || ''; const handleCopyLink = async () => {