Fix comparison badge to update in real-time across components
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 35s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m13s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s

- Move comparison state from hook to shared context provider
- All components now share the same state instance
- Badge count updates immediately when schools are added/removed
- Add key prop to badge to re-trigger animation on count change
- Add storage event listener for cross-tab synchronization

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Tudor
2026-02-03 14:26:23 +00:00
parent 18964a34a2
commit 200fccb615
4 changed files with 103 additions and 59 deletions

View File

@@ -48,7 +48,9 @@ export function Navigation() {
>
Compare
{selectedSchools.length > 0 && (
<span className={styles.badge}>{selectedSchools.length}</span>
<span key={selectedSchools.length} className={styles.badge}>
{selectedSchools.length}
</span>
)}
</Link>
<Link