Share button now shows Facebook icon with pre-filled post text
All checks were successful
Build frontend / build (push) Successful in 42s

- Facebook SVG icon instead of generic share icon
- Post includes property title + address + link
This commit is contained in:
Claw AI
2026-03-30 00:26:28 +00:00
parent d3242a4147
commit 1a96e457ca

View File

@ -344,12 +344,17 @@ export default function PropertyDetailsPage() {
</button>
<button
onClick={() => {
const title = encodeURIComponent(property?.title || 'عقار');
const url = encodeURIComponent(window.location.href);
window.open(`https://www.facebook.com/sharer/sharer.php?u=${url}`, '_blank', 'width=600,height=400');
const quote = encodeURIComponent(`${property?.title || 'عقار'} - SweetHome\n${property?.location?.address || ''}`);
window.open(`https://www.facebook.com/sharer/sharer.php?u=${url}&quote=${quote}`, '_blank', 'width=600,height=400');
}}
className="p-2 hover:bg-gray-100 rounded-full transition-colors"
className="p-2 hover:bg-blue-50 rounded-full transition-colors flex items-center gap-1"
title="مشاركة على فيسبوك"
>
<Share2 className="w-5 h-5 text-gray-600" />
<svg className="w-5 h-5 text-blue-600" viewBox="0 0 24 24" fill="currentColor">
<path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/>
</svg>
</button>
</div>
</div>