-
Notifications
You must be signed in to change notification settings - Fork 33
feat: Relates to #264. Add drop-down menu with Backup Account and Add Tokens #318
Conversation
Edit: removed the close button |
@Tbaut I've addressed your latest review comments. It has a bug that I've mentioned below, but want to get your feedback before I spend more time on it. Usage: It now shows three-dots icon when not menu not open, then when click three-dots icon it displays cross icon overlay along with the menu. The menu now has drop-shadow that darkens upon hover. If you hover over the menu items the font colour lightens. I've added a spacer between the menu items. I've made each menu item a div instead of a href as it's annoying having to precisely click on the link text instead of anywhere on the menu item row. If you click the cross icon it closes the menu. Likewise if you click anywhere else other than the menu area it closes the menu. BUG: Whilst the user can also now close the menu by clicking anywhere outside the menu area to close the menu (i.e. blur), doing so correctly closes the menu, however it still shows the cross icon instead of switching back to the triple-dot icon. So to show the menu again the user has to first click the cross icon so it turns back into a triple-dot, and then click the triple-dot to open the menu again. Screenshot: |
Additionally since we're moving to Semantic UI as mentioned by @amaurymartiny we could try replacing the icons with https://react.semantic-ui.com/elements/icon/ (i.e. |
I'm sorry to slightly change my mind, I've had a look at a lot of apps out there, most such as Whatsapp do not show such a close button. The overall look and feel from the dropdown is good otherwise. I'd also drop the border bottom from the spacer, it lets the menu feel lighter. Regarding the close on "click away" I think there should be a layer (with a z-index on the the wrapper?) above any window element so that you can actually click anywhere, even on an account card, and all this would do it close the menu. Example on Github, click the edit button, and then click on a link while the menu is open. What happens is that the menu gets closed, but the link you clicked didn't redirect you. |
SUI's Popup with on="click" does exactly the above behavior (reverify that the invisible layer does indeed catch the click). |
… show/hide menu without state * Use CSS to show/hide menu instead of using React state. Menu and overlay hidden by default * Overlay is grey to make it clear the user's Call to Action (CTA) is to select a menu item * Use can click overlay to close menu * Remove close icon * Remove spacer line
… menu and overlay
@Tbaut I've addressed your review comments, which fixed the bug too. Thanks for the overlay suggestion, it hadn't come to mind! I've updated it so you click the three-dot icon to open the menu, which also displays a grey/transparent overlay (similar to a modal) that the user can click to close the menu. I've set it up so it auto scrolls incase we add more items than fit in the page in future. i.e. @amaurymartiny Happy to try SUI as any alternative if necessary. |
@Tbaut I've created a component called @amaurymartiny are you ok with this? Should I take it further and use a CSS-in-JS library to move the styles into the component? |
Thanks a lot @ltfschoen |
@Tbaut i've uploaded a couple of videos showing how it appears, please confirm which one you'd like:
i'll update the PR after receiving confirmation of which option you prefer. FYI, i went with the modal-like appearance because i thought it channelled the users focus on the menu (it changes from a lighter to a darker gray and vice versa as they move over the list of menu items). i personally find that a modal-like grayish overlay makes it more obvious that i can close the menu by clicking away from the menu popup |
I'm good with both videos. @ltfschoen Ok to create a component in |
I'd stick with a transparent background for menus because it's the regular behavior for apps. Edit: I've checked dozens of apps and web apps including whatsapp, gmail, medium, twitter, google playstore, none of them apply a grey background. This is reserved for big drawer menus (taking the whole page height). |
Hey @ltfschoen, any roadblock regarding this pr? |
@Tbaut Next step is to try and build the same but based on using SUI Modal or Popup with styled-components so it builds upon something as generic as possible for reusability (instead of this custom job). So I'd leave the PR status as in-progress |
Replaced by this PR that builds a solution based on a SUI popup #356 |
Implementation of this wireframe #264 (comment).
Will allow other items to be listed including View Transactions in subsequent PR to address #98
Screenshot:
Usage: User clicks the icon and the pop-up menu appears. If they click the icon again the popup modal closes. If they click one of the menu items they'll be navigated to the relevant page and the popup menu is no longer shown.