.
This commit is contained in:
@@ -5,6 +5,7 @@ import React, { useState } from 'react';
|
||||
import Link from 'next/link';
|
||||
import { CheckCircle, MapPin, Star, Phone, Share2, Facebook, Linkedin, Instagram, Twitter } from 'lucide-react';
|
||||
import { Business } from '../types';
|
||||
import { toast } from 'react-hot-toast';
|
||||
|
||||
const BusinessCard: React.FC<{ business: Business }> = ({ business }) => {
|
||||
const [isShareOpen, setIsShareOpen] = useState(false);
|
||||
@@ -16,7 +17,7 @@ const BusinessCard: React.FC<{ business: Business }> = ({ business }) => {
|
||||
};
|
||||
|
||||
const handleShare = (platform: string) => {
|
||||
const url = encodeURIComponent(`${window.location.origin}/#/directory/${business.id}`);
|
||||
const url = encodeURIComponent(`${window.location.origin}/annuaire/${business.id}`);
|
||||
const text = encodeURIComponent(`Découvrez ${business.name} sur Afropreunariat`);
|
||||
|
||||
let shareLink = '';
|
||||
@@ -30,11 +31,11 @@ const BusinessCard: React.FC<{ business: Business }> = ({ business }) => {
|
||||
case 'linkedin':
|
||||
shareLink = `https://www.linkedin.com/sharing/share-offsite/?url=${url}`;
|
||||
break;
|
||||
case 'instagram':
|
||||
// Instagram web share is limited, alerting user
|
||||
alert("Pour partager sur Instagram, copiez le lien ou faites une capture d'écran.");
|
||||
setIsShareOpen(false);
|
||||
return;
|
||||
case 'instagram':
|
||||
// Instagram web share is limited, alerting user
|
||||
toast("Pour partager sur Instagram, copiez le lien ou faites une capture d'écran.", { icon: '📸' });
|
||||
setIsShareOpen(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (shareLink) {
|
||||
@@ -100,13 +101,13 @@ const BusinessCard: React.FC<{ business: Business }> = ({ business }) => {
|
||||
<img src={business.logoUrl} alt={business.name} className="w-full h-full object-cover rounded-md bg-gray-50" />
|
||||
</div>
|
||||
|
||||
<Link href={`/directory/${business.id}`} className="absolute inset-0 z-0" aria-label={`Voir ${business.name}`} />
|
||||
<Link href={`/annuaire/${business.slug || business.id}`} className="absolute inset-0 z-0" aria-label={`Voir ${business.name}`} />
|
||||
</div>
|
||||
|
||||
{/* Body */}
|
||||
<div className="pt-8 px-4 pb-4 flex-1 flex flex-col">
|
||||
<div className="flex justify-between items-start">
|
||||
<Link href={`/directory/${business.id}`} className="font-bold text-lg text-gray-900 truncate hover:text-brand-600 transition-colors">
|
||||
<Link href={`/annuaire/${business.slug || business.id}`} className="font-bold text-lg text-gray-900 truncate hover:text-brand-600 transition-colors">
|
||||
{business.name}
|
||||
</Link>
|
||||
{business.verified && <CheckCircle className="w-5 h-5 text-blue-500 flex-shrink-0 ml-1" />}
|
||||
@@ -124,7 +125,7 @@ const BusinessCard: React.FC<{ business: Business }> = ({ business }) => {
|
||||
<span className="text-sm font-bold ml-1 text-gray-700">{business.rating}</span>
|
||||
<span className="text-xs text-gray-400 ml-1">({business.viewCount} vues)</span>
|
||||
</div>
|
||||
<Link href={`/directory/${business.id}`} className="text-brand-600 text-sm font-medium hover:underline">Voir la fiche</Link>
|
||||
<Link href={`/annuaire/${business.slug || business.id}`} className="text-brand-600 text-sm font-medium hover:underline">Voir la fiche</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user