diff --git a/apps/web/src/components/ProgressScreen.tsx b/apps/web/src/components/ProgressScreen.tsx index 671766e..4bd6c9c 100644 --- a/apps/web/src/components/ProgressScreen.tsx +++ b/apps/web/src/components/ProgressScreen.tsx @@ -21,17 +21,20 @@ interface ProgressScreenProps { ratedStalls?: Array<{ stallId: number, stallName: string, rating: number }>; totalCount?: number; serverProgress?: number; + allStalls?: Array<{ id: number, name: string }>; } export default function ProgressScreen({ onScanNext, ratings = {}, totalCount = 11, - serverProgress = 0 + serverProgress = 0, + //allStalls: _allStalls = [] }: ProgressScreenProps) { - // Always use the server's synced progress as the ultimate source of truth, fallback to local if 0 + // Always use the server's synced progress as the ultimate source of truth const localRatedCount = Object.keys(ratings).length; - const ratedCount = Math.max(serverProgress, localRatedCount); + + const ratedCount = serverProgress > 0 ? serverProgress : localRatedCount; return (
@@ -67,6 +70,13 @@ export default function ProgressScreen({
{/* Directory Section */}
+
+ 🏆 +

+ You are voting for the People's Choice Award. +

+
+

Stall Directory

@@ -75,36 +85,37 @@ export default function ProgressScreen({
-
+
{Array.from({ length: totalCount }).map((_, index) => { - const status = ratings[String(index + 1)] !== undefined ? 'rated' : 'locked'; + const stallId = index + 1; + const status = index < ratedCount ? 'rated' : 'locked'; return ( {status === 'rated' ? ( - + ) : ( - + )} {status === 'rated' && ( -
+
)} @@ -117,25 +128,12 @@ export default function ProgressScreen({ - {/* Inner subtle glow */} -
-
-
- 🏆 -

- You are voting for the People's Choice Award. -

-
- -
- ⚠️ -

- Your votes will be counted only if you rate all 11 stalls. -

-
-
+ ⚠️ +

+ Your votes will be counted only if you rate all 11 stalls. +

{/* Scan Button / Completion Action */} @@ -171,11 +169,11 @@ export default function ProgressScreen({ rel="noopener noreferrer" className="flex items-center justify-center gap-3 hover:opacity-80 transition-opacity" > - DK24 + DK24
@@ -229,4 +227,4 @@ export default function ProgressScreen({
); -} \ No newline at end of file +}