Working with menu button

This commit is contained in:
corey@blaishome.online
2025-02-13 22:51:56 -05:00
parent a1f4ef16bd
commit d349924695

View File

@@ -21,15 +21,11 @@ const ScoreTracker = () => {
};
// Handle Add Round, Game Completion, etc.
const handleGameEnd = () => {
// Navigate to the summary page after the game ends
navigate('/summary');
};
// Rest of your component code (Rendering, Button handlers, etc.)
};
// Handle adding a round
const handleAddRound = () => {
// Check if the max number of rounds is reached
@@ -148,13 +144,12 @@ const ScoreTracker = () => {
>
X
</Button>
<Button
<Button
variant="outlined"
onClick={() => navigate('/')}
>
Main Menu
</Button>
</Box>
</Grid>
@@ -185,25 +180,27 @@ const ScoreTracker = () => {
Bullseyes: {state.currentGame.totalBullseyes}
</Typography>
</Grid>
{/* Round history */}
<Grid item xs={12}>
<Box sx={{ maxHeight: '200px', overflow: 'auto' }}>
{state.currentGame && state.currentGame.rounds && state.currentGame.rounds.length > 0 ? (
state.currentGame.rounds.map((round, roundIndex) => (
<Typography key={roundIndex} variant="body2" align="center">
Round {roundIndex + 1}: {round.arrows ? round.arrows.join(', ') : 'No arrows'}
(Total: {round.total || 0}, Bullseyes: {round.bullseyes || 0})
</Typography>
))
) : (
<Typography variant="body2" align="center">
No rounds played yet.
</Typography>
)}
</Box>
</Grid>
</Grid>
{/* Round history */}
<Grid item xs={12}>
<Box sx={{ maxHeight: '200px', overflow: 'auto' }}>
{state.currentGame && state.currentGame.rounds && state.currentGame.rounds.length > 0 ? (
state.currentGame.rounds.map((round, roundIndex) => (
<Typography key={roundIndex} variant="body2" align="center">
Round {roundIndex + 1}: {round.arrows ? round.arrows.join(', ') : 'No arrows'}
(Total: {round.total || 0}, Bullseyes: {round.bullseyes || 0})
</Typography>
))
) : (
<Typography variant="body2" align="center">
No rounds played yet.
</Typography>
)}
</Box>
</Grid>
</Grid>
);
};
export default ScoreTracker;