Share button now shows Facebook icon with pre-filled post text
All checks were successful
Build frontend / build (push) Successful in 42s
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:
@ -344,12 +344,17 @@ export default function PropertyDetailsPage() {
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
const title = encodeURIComponent(property?.title || 'عقار');
|
||||||
const url = encodeURIComponent(window.location.href);
|
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}"e=${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>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user