fix longueur trop haute de la modale d'envoi de mail

This commit is contained in:
Yannick Le Duc
2025-08-25 23:03:33 +02:00
parent 39656b1cc9
commit 1730d77b2c
2 changed files with 20 additions and 20 deletions

View File

@@ -52,12 +52,12 @@ type SortOption =
| 'alphabetical'; | 'alphabetical';
const sortOptions = [ const sortOptions = [
{ value: 'popularity', label: 'Popularité', icon: TrendingUp, description: 'Moyenne décroissante puis nombre de votants' }, { value: 'total_impact', label: 'Impact total', icon: Target, description: 'Somme totale investie' },
{ value: 'total_impact', label: 'Impact total', icon: Target, description: 'Somme totale investie décroissante' }, { value: 'popularity', label: 'Popularité', icon: TrendingUp, description: 'Moyenne puis nombre de votants' },
{ value: 'consensus', label: 'Consensus', icon: Users2, description: 'Plus petit écart-type = plus de consensus' }, { value: 'consensus', label: 'Consensus', icon: Users2, description: 'Plus petit écart-type' },
{ value: 'engagement', label: 'Engagement', icon: Users, description: 'Taux de participation décroissant' }, { value: 'engagement', label: 'Engagement', icon: Users, description: 'Taux de participation' },
{ value: 'distribution', label: 'Répartition', icon: BarChart3, description: 'Nombre de votes différents' }, { value: 'distribution', label: 'Répartition', icon: BarChart3, description: 'Nombre de votes différents' },
{ value: 'alphabetical', label: 'Alphabétique', icon: Hash, description: 'Ordre alphabétique par titre' } { value: 'alphabetical', label: 'Alphabétique', icon: Hash, description: 'Ordre alphabétique' }
]; ];
function CampaignStatsPageContent() { function CampaignStatsPageContent() {
@@ -70,7 +70,7 @@ function CampaignStatsPageContent() {
const [votes, setVotes] = useState<Vote[]>([]); const [votes, setVotes] = useState<Vote[]>([]);
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
const [propositionStats, setPropositionStats] = useState<PropositionStats[]>([]); const [propositionStats, setPropositionStats] = useState<PropositionStats[]>([]);
const [sortBy, setSortBy] = useState<SortOption>('popularity'); const [sortBy, setSortBy] = useState<SortOption>('total_impact');
useEffect(() => { useEffect(() => {
if (campaignId) { if (campaignId) {
@@ -322,19 +322,19 @@ function CampaignStatsPageContent() {
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<span className="text-sm font-medium text-slate-600 dark:text-slate-300">Trier par :</span> <span className="text-sm font-medium text-slate-600 dark:text-slate-300">Trier par :</span>
<Select value={sortBy} onValueChange={(value: SortOption) => setSortBy(value)}> <Select value={sortBy} onValueChange={(value: SortOption) => setSortBy(value)}>
<SelectTrigger className="w-48"> <SelectTrigger className="w-56">
<SelectValue /> <SelectValue />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent className="w-80">
{sortOptions.map((option) => { {sortOptions.map((option) => {
const IconComponent = option.icon; const IconComponent = option.icon;
return ( return (
<SelectItem key={option.value} value={option.value}> <SelectItem key={option.value} value={option.value} className="py-3">
<div className="flex items-center gap-2"> <div className="flex items-center gap-3 w-full">
<IconComponent className="w-4 h-4" /> <IconComponent className="w-4 h-4 flex-shrink-0" />
<div> <div className="min-w-0 flex-1">
<div className="font-medium">{option.label}</div> <div className="font-medium truncate">{option.label}</div>
<div className="text-xs text-slate-500">{option.description}</div> <div className="text-xs text-slate-500 truncate">{option.description}</div>
</div> </div>
</div> </div>
</SelectItem> </SelectItem>

View File

@@ -118,8 +118,8 @@ L'équipe Mes Budgets Participatifs`);
return ( return (
<Dialog open={isOpen} onOpenChange={handleClose}> <Dialog open={isOpen} onOpenChange={handleClose}>
<DialogContent className="sm:max-w-2xl"> <DialogContent className="sm:max-w-2xl max-h-[90vh] flex flex-col">
<DialogHeader> <DialogHeader className="flex-shrink-0">
<DialogTitle className="flex items-center gap-2"> <DialogTitle className="flex items-center gap-2">
<Mail className="w-5 h-5" /> <Mail className="w-5 h-5" />
Envoyer un email à {participant.first_name} {participant.last_name} Envoyer un email à {participant.first_name} {participant.last_name}
@@ -129,7 +129,7 @@ L'équipe Mes Budgets Participatifs`);
</DialogDescription> </DialogDescription>
</DialogHeader> </DialogHeader>
<div className="space-y-4"> <div className="space-y-4 flex-1 overflow-y-auto min-h-0">
{/* Informations du participant */} {/* Informations du participant */}
<div className="p-3 bg-slate-50 dark:bg-slate-800 rounded-lg"> <div className="p-3 bg-slate-50 dark:bg-slate-800 rounded-lg">
<h4 className="text-sm font-medium text-slate-900 dark:text-slate-100 mb-2"> <h4 className="text-sm font-medium text-slate-900 dark:text-slate-100 mb-2">
@@ -163,9 +163,9 @@ L'équipe Mes Budgets Participatifs`);
placeholder="Votre message..." placeholder="Votre message..."
value={message} value={message}
onChange={(e) => setMessage(e.target.value)} onChange={(e) => setMessage(e.target.value)}
rows={12} rows={8}
disabled={sending} disabled={sending}
className="font-mono text-sm" className="font-mono text-sm resize-none"
/> />
<div className="text-xs text-slate-500 dark:text-slate-400"> <div className="text-xs text-slate-500 dark:text-slate-400">
Le lien de vote sera automatiquement inclus dans votre message. Le lien de vote sera automatiquement inclus dans votre message.
@@ -197,7 +197,7 @@ L'équipe Mes Budgets Participatifs`);
)} )}
</div> </div>
<DialogFooter className="flex flex-col sm:flex-row gap-2"> <DialogFooter className="flex flex-col sm:flex-row gap-2 flex-shrink-0 pt-4 border-t border-slate-200 dark:border-slate-700">
<Button <Button
variant="outline" variant="outline"
onClick={handleClose} onClick={handleClose}