Skip to content

Commit 7887b0b

Browse files
feat: add view summary option after drills are complete
1 parent ea115f9 commit 7887b0b

3 files changed

Lines changed: 24 additions & 5 deletions

File tree

src/components/Openings/OpeningDrillSidebar.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,6 @@ export const OpeningDrillSidebar: React.FC<Props> = ({
122122
</div>
123123
) : (
124124
<div className="flex flex-col">
125-
{onLoadCompletedDrill && (
126-
<div className="px-3 py-2 text-xs text-secondary">
127-
Click on any drill below to analyze it
128-
</div>
129-
)}
130125
{completedDrills.map((completedDrill, index) => {
131126
const accuracy =
132127
completedDrill.totalMoves > 0

src/hooks/useOpeningDrillController/useOpeningDrillController.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,11 @@ export const useOpeningDrillController = (
341341
setContinueAnalyzingMode(true) // Allow moves beyond target count
342342
}, [])
343343

344+
// Show final summary modal
345+
const showSummary = useCallback(() => {
346+
setShowFinalModal(true)
347+
}, [])
348+
344349
// Reset drill session for new openings
345350
const resetDrillSession = useCallback(() => {
346351
setAllDrillsCompleted(false)
@@ -899,5 +904,8 @@ export const useOpeningDrillController = (
899904

900905
// Load a specific completed drill for analysis
901906
loadCompletedDrill,
907+
908+
// Show final summary modal
909+
showSummary,
902910
}
903911
}

src/pages/openings/index.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,14 @@ const OpeningsPage: NextPage = () => {
497497
Next Drill
498498
</button>
499499
)}
500+
{controller.areAllDrillsCompleted && (
501+
<button
502+
onClick={controller.showSummary}
503+
className="rounded bg-human-3 px-4 py-2 text-sm font-medium transition-colors hover:bg-human-3/80"
504+
>
505+
View Summary
506+
</button>
507+
)}
500508
</div>
501509
)}
502510
</div>
@@ -583,6 +591,14 @@ const OpeningsPage: NextPage = () => {
583591
Next
584592
</button>
585593
)}
594+
{controller.areAllDrillsCompleted && (
595+
<button
596+
onClick={controller.showSummary}
597+
className="rounded bg-human-3 px-4 py-2 text-sm font-medium"
598+
>
599+
Summary
600+
</button>
601+
)}
586602
</div>
587603

588604
{/* Mobile progress */}

0 commit comments

Comments
 (0)