diff --git a/src/app/campaigns/[id]/vote/[participantId]/page.tsx b/src/app/campaigns/[id]/vote/[participantId]/page.tsx index 96c54a4..4b95ef9 100644 --- a/src/app/campaigns/[id]/vote/[participantId]/page.tsx +++ b/src/app/campaigns/[id]/vote/[participantId]/page.tsx @@ -348,20 +348,22 @@ export default function PublicVotePage() {
{/* Header fixe avec le total et le bouton de validation */}
-
+
-
-
-

{campaign?.title}

-

- {participant?.first_name} {participant?.last_name} -

+
+
+

+ {participant?.first_name} +

+

+ {participant?.last_name} +

-
+
-
{totalVoted}€ / {campaign?.budget_per_user}€
-
- {voteStatus.message} + {voteStatus.message.split(' ').map((word, index, array) => ( + + {word} + {index < array.length - 1 && index === Math.floor(array.length / 2) - 1 ?
: ' '} +
+ ))}
@@ -402,6 +410,7 @@ export default function PublicVotePage() {
+

{campaign?.title}

{/* Slider */}
+ {/* Marqueurs des paliers */} -
- {/* Marqueur 0€ */} -
-
- 0€ -
- - {/* Marqueurs des paliers */} - {spendingTiers.map((tier, index) => { - // Calcul correct de la position pour correspondre au slider - const position = ((index + 1) / spendingTiers.length) * 100; +
+ {/* Fonction pour formater les montants */} + {(() => { + const formatAmount = (amount: number, isMobile: boolean) => { + if (!isMobile) return `${amount}€`; + + // Formatage court sur mobile pour les montants longs + if (amount >= 1000) { + if (amount % 1000 === 0) { + return `${amount / 1000}k€`; + } else { + return `${(amount / 1000).toFixed(1)}k€`; + } + } + return `${amount}€`; + }; + + const isMobile = typeof window !== 'undefined' && window.innerWidth < 640; + return ( -
-
- {tier}€ -
+ <> + {/* Marqueur 0€ */} +
handleVoteChange(proposition.id, 0)} + > +
+ + {formatAmount(0, isMobile)} + +
+ + {/* Marqueurs des paliers */} + {spendingTiers.map((tier, index) => { + // Position uniforme : espacement égal entre tous les marqueurs + // Le dernier palier doit être à 100% + const position = ((index + 1) / spendingTiers.length) * 100; + return ( +
handleVoteChange(proposition.id, tier)} + > +
+ + {formatAmount(tier, isMobile)} + +
+ ); + })} + ); - })} + })()}
{/* Valeur sélectionnée */} {(localVotes[proposition.id] && localVotes[proposition.id] > 0) && !isCompactView && (
- + handleVoteChange(proposition.id, 0)} + title="Cliquer pour remettre à 0€" + > Vote sélectionné : {localVotes[proposition.id]}€