Share button opens Facebook post composer
All checks were successful
Build frontend / build (push) Successful in 57s
All checks were successful
Build frontend / build (push) Successful in 57s
This commit is contained in:
@ -343,17 +343,9 @@ export default function PropertyDetailsPage() {
|
|||||||
<Heart className="w-5 h-5 text-gray-600" />
|
<Heart className="w-5 h-5 text-gray-600" />
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={async () => {
|
onClick={() => {
|
||||||
const url = window.location.href;
|
const url = encodeURIComponent(window.location.href);
|
||||||
const title = property?.title || 'عقار';
|
window.open(`https://www.facebook.com/sharer/sharer.php?u=${url}`, '_blank', 'width=600,height=400');
|
||||||
if (navigator.share) {
|
|
||||||
try {
|
|
||||||
await navigator.share({ title, text: `تحقق من هذا العقار: ${title}`, url });
|
|
||||||
} catch {}
|
|
||||||
} else {
|
|
||||||
await navigator.clipboard.writeText(url);
|
|
||||||
toast.success('تم نسخ الرابط');
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
className="p-2 hover:bg-gray-100 rounded-full transition-colors"
|
className="p-2 hover:bg-gray-100 rounded-full transition-colors"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user