fix(bounty-twice): Fixed Duplicate PopUp Issue When Viewing Bounty From Profile #1269
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
When viewing a bounty in the profile (both under
Created
andAssigned
sections), the bounty detail page is incorrectly displayed twice. This appears to be a result of the default behavior of the anchor tags in thePanel
components, causing duplicate navigation actions.Expected Behavior:
The expected behavior is that when a user clicks on a bounty in their profile, the bounty detail page should appear only once, providing a clean and user-friendly experience.
Issue ticket number and link:
Solution:
The issue was resolved by preventing the default action of the anchor tags in the
Panel
components within bothUserTicketView.tsx
andWanted.tsx
files. This was achieved by addinge.preventDefault()
in theonClick
event handlers, thus stopping the default navigation and allowing for the custom routing logic to execute correctly.Changes:
UserTicketView.tsx
, modified theonPanelClick
function to includee.preventDefault()
to stop the anchor tag from triggering a page load.Wanted.tsx
, addede.preventDefault()
in theonClick
handler of the Panel component to prevent default navigation and instead use thehistory.push()
method for navigation.Evidence:
Please see the attached video as evidence.
Testing:
Created
andAssigned
sections of the profile to ensure that the detail page opens correctly.Notes:
Please review the changes and merge this PR if everything is in order.