Skip to content

Commit

Permalink
fix(MacroGoal): fix delete goal
Browse files Browse the repository at this point in the history
  • Loading branch information
marycaserio committed Nov 8, 2024
1 parent 757341a commit 9e0cc50
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/Home/MacroGoal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ const MacroGoal = ({ macroGoal, macroGoalIndex }) => {
navigate(`/goals/${macroGoalIndex}`)
}

const handleDeleteClick = (event) => {
event.stopPropagation() // Prevents the onClick from triggering navigation
}

return (
<Paper elevation={2} sx={{ p: 2, mb: 3, borderRadius: 2 }}>
<Box
Expand All @@ -24,7 +28,9 @@ const MacroGoal = ({ macroGoal, macroGoalIndex }) => {
<Typography variant='h6' sx={{ flexGrow: 1, ml: 2 }}>
{macroGoal.name}
</Typography>
<DeleteItem goalIndex={macroGoalIndex} />
<div onClick={handleDeleteClick} sx={{ display: 'inline-flex' }}>
<DeleteItem goalIndex={macroGoalIndex} />
</div>
</Box>
</Paper>
)
Expand Down

0 comments on commit 9e0cc50

Please sign in to comment.