feat: rank change toast + streak milestone icons

Toast notification on rank change (up/down).
Streak display with milestones: 🔥 at 3, 🔥🔥 at 10,  at 20.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ronny
2026-04-11 19:12:02 +02:00
parent 6c3ad56515
commit 17b86df857
5 changed files with 85 additions and 3 deletions
+9 -3
View File
@@ -7,6 +7,14 @@ interface Props {
devUser?: number;
}
function formatStreak(streak: number): string {
if (streak >= 20) return `${streak}`;
if (streak >= 10) return `🔥🔥${streak}`;
if (streak >= 3) return `🔥${streak}`;
if (streak > 0) return String(streak);
return '0';
}
function formatCountdown(minutes: number): string {
if (minutes < 60) return `in ${minutes} Min`;
if (minutes < 60 * 24) return `in ${Math.floor(minutes / 60)}h`;
@@ -108,9 +116,7 @@ export default function DashboardPage(_props: Props) {
<span className={styles.statLabel}>Punkte</span>
</div>
<div className={styles.statTile}>
<span className={styles.statValue}>
{stats.streak > 0 ? `${stats.streak} 🔥` : stats.streak}
</span>
<span className={styles.statValue}>{formatStreak(stats.streak)}</span>
<span className={styles.statLabel}>Streak</span>
</div>
</div>