From 06c037a76e563b5e3bb49010a2c5ceef0eef4a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Wed, 23 Jul 2025 20:39:03 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20ajout=C3=A9=20v=C3=A9rification=20d?= =?UTF-8?q?=C3=A9lai=20vote=20dans=20VersionTimeline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Calcul isVoteDisabled basé sur 3 jours après création - Désactivation VoteButtons pour versions anciennes - Chip visuel "Vote fermé" pour versions expirées - Cohérence avec VersionPage et VersionComparison --- components/versions/version-timeline.js | 34 ++++++++++++++++++++----- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/components/versions/version-timeline.js b/components/versions/version-timeline.js index 62235c8..7c272a9 100644 --- a/components/versions/version-timeline.js +++ b/components/versions/version-timeline.js @@ -116,6 +116,11 @@ function VersionCard({ const statusConfig = getStatusConfig(status) const userDisplayName = version.user_created?.split('-')[0] || 'Système' + // Check if voting is disabled (after 3 days) + const createdAt = new Date(version.date_created) + const threeDaysAgo = new Date(Date.now() - (3 * 24 * 60 * 60 * 1000)) + const isVoteDisabled = createdAt < threeDaysAgo + const handleCompareClick = async () => { const comparisonData = await compareVersion({ accessToken, @@ -171,12 +176,22 @@ function VersionCard({ - + + + {isVoteDisabled && ( + + )} + @@ -204,7 +219,12 @@ function VersionCard({ size='small' variant='text' /> - +