From 3710396d172512cae65096ba53e7f28b0facbb17 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez Date: Tue, 8 Oct 2024 13:46:31 +0200 Subject: [PATCH 1/7] Fix coupons bar --- src/common/components/Timer.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/components/Timer.jsx b/src/common/components/Timer.jsx index bfab1efd5..41ed326c5 100644 --- a/src/common/components/Timer.jsx +++ b/src/common/components/Timer.jsx @@ -68,11 +68,11 @@ function Timer({ startingAt, onFinish, autoRemove, variant, ...rest }) { if (loading) return ; return ( - {autoRemove && timer?.months <= 0 ? null : `${timer?.months}m `} - {autoRemove && timer?.days <= 0 ? null : `${timer?.days}d `} - {autoRemove && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer?.hours}h `} - {autoRemove && timer?.minutes <= 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer.minutes}m `} - {timer.seconds} + {autoRemove && timer?.months <= 0 ? null : `${timer?.months} months `} + {autoRemove && timer?.days <= 0 ? null : `${timer?.days} days `} + {autoRemove && timer?.months <= 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer?.hours} hours `} + {autoRemove && timer?.days <= 0 && timer?.minutes <= 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer.minutes} minutes `} + {timer?.hours <= 0 && timer.seconds} s ); From c1f1f78f8b8f85d256ca4e0ed4832e0d7b464f0e Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez Date: Tue, 8 Oct 2024 13:47:26 +0200 Subject: [PATCH 2/7] Change seconds label --- src/common/components/Timer.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/components/Timer.jsx b/src/common/components/Timer.jsx index 41ed326c5..de4334bb1 100644 --- a/src/common/components/Timer.jsx +++ b/src/common/components/Timer.jsx @@ -72,8 +72,7 @@ function Timer({ startingAt, onFinish, autoRemove, variant, ...rest }) { {autoRemove && timer?.days <= 0 ? null : `${timer?.days} days `} {autoRemove && timer?.months <= 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer?.hours} hours `} {autoRemove && timer?.days <= 0 && timer?.minutes <= 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer.minutes} minutes `} - {timer?.hours <= 0 && timer.seconds} - s + {timer?.hours <= 0 && `${timer.seconds} seconds`} ); } From f905d808a525558979ef74e36209bfffd79d6eb1 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:57:20 +0200 Subject: [PATCH 3/7] Update Timer.jsx --- src/common/components/Timer.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/components/Timer.jsx b/src/common/components/Timer.jsx index de4334bb1..274999dbc 100644 --- a/src/common/components/Timer.jsx +++ b/src/common/components/Timer.jsx @@ -70,8 +70,8 @@ function Timer({ startingAt, onFinish, autoRemove, variant, ...rest }) { {autoRemove && timer?.months <= 0 ? null : `${timer?.months} months `} {autoRemove && timer?.days <= 0 ? null : `${timer?.days} days `} - {autoRemove && timer?.months <= 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer?.hours} hours `} - {autoRemove && timer?.days <= 0 && timer?.minutes <= 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer.minutes} minutes `} + {autoRemove && timer?.months > 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer?.hours} hours `} + {autoRemove && timer?.days > 0 && timer?.minutes <= 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer.minutes} minutes `} {timer?.hours <= 0 && `${timer.seconds} seconds`} ); From 157b18deb4061f98954986cabf60b1f4944dcf82 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:58:59 +0200 Subject: [PATCH 4/7] Update Timer.jsx --- src/common/components/Timer.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/components/Timer.jsx b/src/common/components/Timer.jsx index 274999dbc..f27aac6e7 100644 --- a/src/common/components/Timer.jsx +++ b/src/common/components/Timer.jsx @@ -68,10 +68,10 @@ function Timer({ startingAt, onFinish, autoRemove, variant, ...rest }) { if (loading) return ; return ( - {autoRemove && timer?.months <= 0 ? null : `${timer?.months} months `} - {autoRemove && timer?.days <= 0 ? null : `${timer?.days} days `} - {autoRemove && timer?.months > 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer?.hours} hours `} - {autoRemove && timer?.days > 0 && timer?.minutes <= 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer.minutes} minutes `} + {autoRemove && timer?.months <= 0 ? null : `${timer?.months} ${timer?.months === 1 ? 'month' : 'months'} `} + {autoRemove && timer?.days <= 0 ? null : `${timer?.days} ${timer?.days === 1 ? 'day' : 'days'} `} + {autoRemove && timer?.months > 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer?.hours} ${timer?.hours === 1 ? 'hour' : 'hours'} `} + {autoRemove && timer?.days > 0 && timer?.minutes <= 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer.minutes} ${timer?.minutes === 1 ? 'minute' : 'minutes'} `} {timer?.hours <= 0 && `${timer.seconds} seconds`} ); From b5ff539dd3a53257a062436dab8c09c7afa7ea70 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez Date: Tue, 8 Oct 2024 14:04:49 +0200 Subject: [PATCH 5/7] Add translations --- public/locales/en/common.json | 5 +++++ public/locales/es/common.json | 5 +++++ src/common/components/Timer.jsx | 10 +++++----- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 3f7211cdd..5f21ee736 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -20,10 +20,15 @@ "on": "on", "with": "with", "for": "for", + "minute": "minute", + "hour": "hour", "day": "day", "week": "week", "month": "month", "year": "year", + "seconds": "seconds", + "minutes": "minutes", + "hours": "hours", "days": "days", "weeks": "weeks", "months": "months", diff --git a/public/locales/es/common.json b/public/locales/es/common.json index 2be4488d7..037d060b2 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -20,10 +20,15 @@ "on": "en", "with": "con", "for": "para", + "minute": "minuto", + "hour": "hora", "day": "día", "week": "semana", "month": "mes", "year": "año", + "seconds": "segundos", + "minutes": "minutos", + "hours": "horas", "days": "días", "weeks": "semanas", "months": "meses", diff --git a/src/common/components/Timer.jsx b/src/common/components/Timer.jsx index f27aac6e7..3458ce07f 100644 --- a/src/common/components/Timer.jsx +++ b/src/common/components/Timer.jsx @@ -68,11 +68,11 @@ function Timer({ startingAt, onFinish, autoRemove, variant, ...rest }) { if (loading) return ; return ( - {autoRemove && timer?.months <= 0 ? null : `${timer?.months} ${timer?.months === 1 ? 'month' : 'months'} `} - {autoRemove && timer?.days <= 0 ? null : `${timer?.days} ${timer?.days === 1 ? 'day' : 'days'} `} - {autoRemove && timer?.months > 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer?.hours} ${timer?.hours === 1 ? 'hour' : 'hours'} `} - {autoRemove && timer?.days > 0 && timer?.minutes <= 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer.minutes} ${timer?.minutes === 1 ? 'minute' : 'minutes'} `} - {timer?.hours <= 0 && `${timer.seconds} seconds`} + {autoRemove && timer?.months <= 0 ? null : `${timer?.months} ${timer?.months === 1 ? t('word-connector.month') : t('word-connector.months')} `} + {autoRemove && timer?.days <= 0 ? null : `${timer?.days} ${timer?.days === 1 ? t('word-connector.day') : t('word-connector.days')} `} + {autoRemove && timer?.months > 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer?.hours} ${timer?.hours === 1 ? t('word-connector.hour') : t('word-connector.hours')} `} + {autoRemove && timer?.days > 0 && timer?.minutes <= 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer.minutes} ${timer?.minutes === 1 ? t('word-connector.minute') : t('word-connector.minutes')} `} + {timer?.hours <= 0 && `${timer.seconds} ${t('word-connector.seconds')}`} ); } From 857cce4a72463fda8431604b36f757713f6681a9 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Tue, 8 Oct 2024 14:38:05 +0200 Subject: [PATCH 6/7] Update Timer.jsx --- src/common/components/Timer.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/components/Timer.jsx b/src/common/components/Timer.jsx index 3458ce07f..6c0d354f7 100644 --- a/src/common/components/Timer.jsx +++ b/src/common/components/Timer.jsx @@ -70,8 +70,8 @@ function Timer({ startingAt, onFinish, autoRemove, variant, ...rest }) { {autoRemove && timer?.months <= 0 ? null : `${timer?.months} ${timer?.months === 1 ? t('word-connector.month') : t('word-connector.months')} `} {autoRemove && timer?.days <= 0 ? null : `${timer?.days} ${timer?.days === 1 ? t('word-connector.day') : t('word-connector.days')} `} - {autoRemove && timer?.months > 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer?.hours} ${timer?.hours === 1 ? t('word-connector.hour') : t('word-connector.hours')} `} - {autoRemove && timer?.days > 0 && timer?.minutes <= 0 && timer?.hours <= 0 && timer?.days <= 0 ? null : `${timer.minutes} ${timer?.minutes === 1 ? t('word-connector.minute') : t('word-connector.minutes')} `} + {autoRemove && timer?.months > 0 || (timer?.hours <= 0 && timer?.days <= 0) ? null : `${timer?.hours} ${timer?.hours === 1 ? t('word-connector.hour') : t('word-connector.hours')} `} + {autoRemove && timer?.days > 0 || (timer?.minutes <= 0 && timer?.hours <= 0 && timer?.days <= 0) ? null : `${timer.minutes} ${timer?.minutes === 1 ? t('word-connector.minute') : t('word-connector.minutes')} `} {timer?.hours <= 0 && `${timer.seconds} ${t('word-connector.seconds')}`} ); From 3f4c4058055d3ecc81c51dec1faae468d874b5bf Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Tue, 8 Oct 2024 14:41:59 +0200 Subject: [PATCH 7/7] Update Timer.jsx --- src/common/components/Timer.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/components/Timer.jsx b/src/common/components/Timer.jsx index 6c0d354f7..917f847ea 100644 --- a/src/common/components/Timer.jsx +++ b/src/common/components/Timer.jsx @@ -70,8 +70,8 @@ function Timer({ startingAt, onFinish, autoRemove, variant, ...rest }) { {autoRemove && timer?.months <= 0 ? null : `${timer?.months} ${timer?.months === 1 ? t('word-connector.month') : t('word-connector.months')} `} {autoRemove && timer?.days <= 0 ? null : `${timer?.days} ${timer?.days === 1 ? t('word-connector.day') : t('word-connector.days')} `} - {autoRemove && timer?.months > 0 || (timer?.hours <= 0 && timer?.days <= 0) ? null : `${timer?.hours} ${timer?.hours === 1 ? t('word-connector.hour') : t('word-connector.hours')} `} - {autoRemove && timer?.days > 0 || (timer?.minutes <= 0 && timer?.hours <= 0 && timer?.days <= 0) ? null : `${timer.minutes} ${timer?.minutes === 1 ? t('word-connector.minute') : t('word-connector.minutes')} `} + {(autoRemove && timer?.hours <= 0 && timer?.days <= 0) || timer?.months > 0 ? null : `${timer?.hours} ${timer?.hours === 1 ? t('word-connector.hour') : t('word-connector.hours')} `} + {(autoRemove && timer?.minutes <= 0 && timer?.hours <= 0 && timer?.days <= 0) || timer?.days > 0 ? null : `${timer.minutes} ${timer?.minutes === 1 ? t('word-connector.minute') : t('word-connector.minutes')} `} {timer?.hours <= 0 && `${timer.seconds} ${t('word-connector.seconds')}`} );