fix: show pending tips in profile, count all tips not just evaluated
Build & Deploy Tippspiel / build (push) Successful in 50s

- Profile tip history now shows all tips (not just evaluated)
- Pending tips display  badge in blue instead of hiding
- Fun Facts "Tipps abgegeben" counts all tips (from tips API)
- Added .badgePending CSS style

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ronny
2026-04-12 18:42:26 +02:00
parent f8a1887c0d
commit 75a028a43e
2 changed files with 9 additions and 5 deletions
@@ -201,6 +201,11 @@
color: var(--text-muted);
border: 1px solid var(--border-subtle);
}
.badgePending {
background: rgba(75, 183, 248, 0.1);
color: var(--primary);
border: 1px solid rgba(75, 183, 248, 0.2);
}
/* ── Fun stats ── */
.funStats { display: flex; flex-direction: column; gap: 12px; }
+4 -5
View File
@@ -73,21 +73,20 @@ export default function ProfilePage() {
if (loading) return <div className={styles.loading}><div className={styles.spinner} /></div>;
if (!stats) return <div className={styles.empty}>Profil nicht verfügbar.</div>;
const evaluatedTips = tips.filter(t => t.points !== null);
const recentTips = evaluatedTips.slice(0, 10);
const recentTips = tips.slice(0, 10);
const favTip = mostCommonTip(tips);
const homePct = homeWinPct(tips);
function pointBadgeClass(points: number | null) {
if (points === null) return '';
if (points === null) return styles.badgePending;
if (points >= 3) return styles.badgeExact;
if (points >= 1) return styles.badgeTendency;
return styles.badgeWrong;
}
function pointLabel(points: number | null) {
if (points === null) return '';
if (points === null) return '';
if (points >= 3) return `${points} Pkt ✓✓`;
if (points >= 1) return `${points} Pkt ✓`;
return `${points} Pkt ✗`;
@@ -203,7 +202,7 @@ export default function ProfilePage() {
<div className={`card ${styles.funCard}`}>
<span className={styles.funIcon}>📊</span>
<span className={styles.funLabel}>Tipps abgegeben</span>
<span className={styles.funValue}>{stats.tipsCount}</span>
<span className={styles.funValue}>{tips.length}</span>
</div>
</div>
</div>