Bug Fix for "Transfer and Block this User" Pop-up Overlaps with Transfer Fund Modal Dialog
This is another contribution to busy.org. This is so far the second more challenging bug I've fixed for a React/Redux web application. The first one being the bug fix for unsaved drafts.
1. The Issue
From the bug report author:
"Transfer / Block this user" pop-up should disappear before Transfer funds pop-up displays.
2. The Solution
There were three (3) files changed:
src/user/User.js
src/user/UserHero.js
src/components/UserHeader.js
The hierarchy of components is :
User
>UserHero
>UserHeader
>Popover
>PopoverMenu
>PopoverMenuItem
2.1. src/user/User.js
- Added
popoverVisible
state- This holds the state whether the popover is displayed or hidden;
- In
handleUserMenuSelect
, setpopoverVisible
to false- When a
PopoverMenuItem
is selected, this is where thePopover
dialog should be hidden;
- When a
- Added
handleVisibleChange
function- This is for handling the setting of the
popoverVisible
state;
- This is for handling the setting of the
2.2. src/user/UserHero.js
- Added
isPopoverVisible
andhandleVisibleChange
properties- For the
Popover
to receive theisPopoverVisible
state and thehandleVisibleChange
function, these need to be passed asUserHero
properties;
- For the
2.3. src/components/UserHeader.js
- Added
isPopoverVisible
andhandleVisibleChange
asUserHeader
properties- To receive the
isPopoverVisible
state and thehandleVisibleChange
function fromUserHero
, these needed to be added as properties and then set as parameters when creating aPopover
component;
- To receive the
3. Demonstration
Here is a short demonstration of the fix in my development environment:
Open Source Contribution posted via Utopian.io
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Hey @eastmael I am @utopian-io. I have just super-voted you at 18% Power!
Suggestions https://utopian.io/rules
Achievements
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x