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" />
|
||||
</button>
|
||||
<button
|
||||
onClick={async () => {
|
||||
const url = window.location.href;
|
||||
const title = property?.title || 'عقار';
|
||||
if (navigator.share) {
|
||||
try {
|
||||
await navigator.share({ title, text: `تحقق من هذا العقار: ${title}`, url });
|
||||
} catch {}
|
||||
} else {
|
||||
await navigator.clipboard.writeText(url);
|
||||
toast.success('تم نسخ الرابط');
|
||||
}
|
||||
onClick={() => {
|
||||
const url = encodeURIComponent(window.location.href);
|
||||
window.open(`https://www.facebook.com/sharer/sharer.php?u=${url}`, '_blank', 'width=600,height=400');
|
||||
}}
|
||||
className="p-2 hover:bg-gray-100 rounded-full transition-colors"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user