Skip to content

Commit

Permalink
Merge pull request #1640 from tommygonzaleza/main
Browse files Browse the repository at this point in the history
Improve coupons bar
  • Loading branch information
tommygonzaleza authored Oct 8, 2024
2 parents 4059195 + 3f4c405 commit 184fc64
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions public/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 5 additions & 6 deletions src/common/components/Timer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,11 @@ function Timer({ startingAt, onFinish, autoRemove, variant, ...rest }) {
if (loading) return <Spinner margin="auto" color={rest.color || 'blue.default'} />;
return (
<Text {...rest}>
{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}
s
{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?.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')}`}
</Text>
);
}
Expand Down

0 comments on commit 184fc64

Please sign in to comment.