Skip to content

Commit

Permalink
chore: enhance BoostProgress component with last valid boost information
Browse files Browse the repository at this point in the history
  • Loading branch information
lawvs committed Oct 23, 2024
1 parent 619aa82 commit 968fe2d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion apps/renderer/src/modules/boost/boost-progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ export const BoostProgress = ({
level,
boostCount,
remainingBoostsToLevelUp,
lastValidBoost,
}: {
level: number
boostCount: number
remainingBoostsToLevelUp: number
lastValidBoost: {
hash: string | null
expiresAt: string
} | null
}) => {
const percentage = (boostCount / (boostCount + remainingBoostsToLevelUp)) * 100
const nextLevel = level + 1
Expand Down Expand Up @@ -41,8 +46,14 @@ export const BoostProgress = ({
<span className="text-lg font-bold text-accent">Lv. {nextLevel}</span>
</div>
<small className="center mt-1 gap-1">
{remainingBoostsToLevelUp} more boost will unlock the next level of privilege.
{remainingBoostsToLevelUp} more boost will unlock the next level of benefits!
</small>
{lastValidBoost && (
<small className="center mt-1 gap-1">
You can't add more boost points right now, but feel free to keep boosting. Your current
boost will expire on {new Date(lastValidBoost.expiresAt).toLocaleDateString()}.
</small>
)}
</div>
)
}

0 comments on commit 968fe2d

Please sign in to comment.