Bug Fix for "Transfer and Block this User" Pop-up Overlaps with Transfer Fund Modal Dialog

in #utopian-io7 years ago

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

image.png

  • Added popoverVisible state
    • This holds the state whether the popover is displayed or hidden;
  • In handleUserMenuSelect, set popoverVisible to false
    • When a PopoverMenuItem is selected, this is where the Popover dialog should be hidden;
  • Added handleVisibleChange function
    • This is for handling the setting of the popoverVisible state;

2.2. src/user/UserHero.js

  • Added isPopoverVisible and handleVisibleChange properties
    • For the Popover to receive the isPopoverVisible state and the handleVisibleChange function, these need to be passed as UserHero properties;

2.3. src/components/UserHeader.js

userheader.png

  • Added isPopoverVisible and handleVisibleChange as UserHeader properties
    • To receive the isPopoverVisible state and the handleVisibleChange function from UserHero, these needed to be added as properties and then set as parameters when creating a Popover component;

3. Demonstration

Here is a short demonstration of the fix in my development environment:



Open Source Contribution posted via Utopian.io

Sort:  

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

  • Your contribution is less informative than others in this category.
  • Utopian has detected 2 bot votes. I am the only bot you should love!!

Achievements

  • I am a bot...I love developers... <3
  • You have less than 500 followers. Just gave you a gift ;)
  • Seems like you contribute quite often. AMAZING!
  • You have a good amount of votes on your contributions. Good job!
    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

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 60305.38
ETH 2447.61
USDT 1.00
SBD 2.51