Skip to content

Commit c295b5a

Browse files
Fix affiliate table layout
Adjusted column widths and added overflow handling to the affiliate table to prevent content overlap and ensure proper display within the modal.
1 parent 0739a59 commit c295b5a

2 files changed

Lines changed: 25 additions & 27 deletions

File tree

src/components/AffiliateStatsCell.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ export const AffiliateStatsCell = ({ affiliateId, commissionRate }: AffiliateSta
1919
const totalRevenue = stats.commissions / (commissionRate / 100);
2020

2121
return (
22-
<div className="space-y-1">
23-
<div className="text-xs text-slate-600">
24-
Taux: <span className="font-medium">{conversionRate.toFixed(1)}%</span>
22+
<div className="text-xs space-y-0.5">
23+
<div className="text-slate-600 leading-tight">
24+
<span className="font-medium text-slate-900">{conversionRate.toFixed(1)}%</span>
2525
</div>
26-
<div className="text-xs text-slate-600">
27-
CA: <span className="font-medium">{convertAndFormat(totalRevenue)}</span>
26+
<div className="text-slate-500 leading-tight">
27+
{convertAndFormat(totalRevenue)}
2828
</div>
2929
</div>
3030
);

src/components/AffiliateTableRow.tsx

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,48 +33,46 @@ export const AffiliateTableRow = ({ affiliate, onEdit, onCopyTrackingLink, onDel
3333
<span className="font-mono truncate text-xs">{affiliate.trackingCode}</span>
3434
</div>
3535
</TableCell>
36-
<TableCell>
36+
<TableCell className="w-[15%] max-w-0 overflow-hidden">
3737
{affiliate.createdAt && (
38-
<div className="flex items-center gap-1 text-sm text-slate-600">
39-
<Calendar className="h-3 w-3" />
40-
<span>{format(affiliate.createdAt, 'dd MMM yyyy', { locale: fr })}</span>
38+
<div className="flex items-center gap-1 text-xs text-slate-600">
39+
<Calendar className="h-3 w-3 flex-shrink-0" />
40+
<span className="truncate">{format(affiliate.createdAt, 'dd MMM yyyy', { locale: fr })}</span>
4141
</div>
4242
)}
4343
</TableCell>
44-
<TableCell>
44+
<TableCell className="w-[15%] max-w-0 overflow-hidden">
4545
<AffiliateStatsCell affiliateId={affiliate.id} commissionRate={affiliate.commissionRate} />
4646
</TableCell>
47-
<TableCell>
47+
<TableCell className="w-[15%] max-w-0 overflow-hidden">
4848
<StripeConnectButton affiliate={affiliate} />
4949
</TableCell>
50-
<TableCell>
51-
<div className="flex items-center justify-end gap-2">
50+
<TableCell className="w-[10%] max-w-0 overflow-hidden">
51+
<div className="flex items-center justify-end gap-1">
5252
<Button
5353
variant="outline"
5454
size="sm"
5555
onClick={() => onEdit(affiliate)}
56-
className="rounded-xl"
56+
className="rounded-lg h-8 w-8 p-0"
5757
>
58-
<Edit2 className="h-4 w-4" />
58+
<Edit2 className="h-3 w-3" />
5959
</Button>
6060
<Button
6161
variant="outline"
6262
size="sm"
6363
onClick={() => onCopyTrackingLink(affiliate.id)}
64-
className="rounded-xl"
64+
className="rounded-lg h-8 w-8 p-0"
6565
>
66-
<Copy className="h-4 w-4" />
66+
<Copy className="h-3 w-3" />
67+
</Button>
68+
<Button
69+
variant="outline"
70+
size="sm"
71+
onClick={() => onDelete(affiliate)}
72+
className="rounded-lg h-8 w-8 p-0 text-red-600 hover:bg-red-50 hover:text-red-700 border-red-200"
73+
>
74+
<X className="h-3 w-3" />
6775
</Button>
68-
<div className="ml-3 border-l border-slate-200 pl-3">
69-
<Button
70-
variant="outline"
71-
size="sm"
72-
onClick={() => onDelete(affiliate)}
73-
className="rounded-xl text-red-600 hover:bg-red-50 hover:text-red-700 border-red-200"
74-
>
75-
<X className="h-4 w-4" />
76-
</Button>
77-
</div>
7876
</div>
7977
</TableCell>
8078
</TableRow>

0 commit comments

Comments
 (0)