Skip to content

Commit

Permalink
Update Timer.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
tommygonzaleza authored Oct 8, 2024
1 parent f905d80 commit 157b18d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/common/components/Timer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ 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} 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`}
</Text>
);
Expand Down

0 comments on commit 157b18d

Please sign in to comment.