Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.

feat: Relates to #264. SUI-based drop-down menu with Backup Account and Add Tokens#356

Merged
ltfschoen merged 26 commits intomasterfrom
luke-264-account-screen-menu-alternative
Jan 19, 2019
Merged

feat: Relates to #264. SUI-based drop-down menu with Backup Account and Add Tokens#356
ltfschoen merged 26 commits intomasterfrom
luke-264-account-screen-menu-alternative

Conversation

@ltfschoen
Copy link
Contributor

  • Usage: On the "Account List" page, click and account to be taken to its "Account" page.
    Then click the icon with the three dots to open the menu. Or click anywhere else to hide it.

  • Replaces PR feat: Relates to #264. Add drop-down menu with Backup Account and Add Tokens #318.

  • Previous review comments adopted for the menu:

    • Account page menu now based on Semantic UI (SUI) Popup instead of custom job.
    • Place the modal above the button (this means we cannot use popup arrow)
    • Max menu height
    • Transparent background around the menu (i.e. not grey like a modal)
  • Proposed changes to previous discussion:

    • Use a SUIButton style (i.e. black border, white background)
      for menu items instead of just ordinary text
    • If multiple menu items have short names they will be next to each other
      potentially saving the user from scrolling too much if we end up having many items

Screenshots

How it looks with just the two current menu items:
screen shot 2019-01-13 at 12 47 50 pm

How it would look if we had lots of menu items:
screen shot 2019-01-13 at 12 46 38 pm

View of the page with just the "three dots" menu icon in the top right that a user can click on:
screen shot 2019-01-13 at 12 48 10 pm

@Tbaut
Copy link
Collaborator

Tbaut commented Jan 13, 2019

Thanks Luke. I haven't tested it yet. Can we make it so that it looks like on the mockup (#264)? With simple lines instead of buttons.

@ltfschoen
Copy link
Contributor Author

Thanks Luke. I haven't tested it yet. Can we make it so that it looks like on the mockup (#264)? With simple lines instead of buttons.

Sure will do

@ltfschoen
Copy link
Contributor Author

ltfschoen commented Jan 13, 2019

@Tbaut I've updated it so the menu items are like before but with light grey background colour transition effect applied to the item being hovered over.

Screenshot with two items:
screen shot 2019-01-14 at 3 20 17 am

Screenshot with multiple items causing scrollbar to appear:
screen shot 2019-01-14 at 3 19 45 am

@Tbaut
Copy link
Collaborator

Tbaut commented Jan 14, 2019

Just tested, that looks pretty good! A couple comments:

  • Can we have this behavior that the menu stays displayed as long as the user doesn't click away? (no autoclose)
  • Could we use the same styling as the other menus for hovers (black on dark grey). Like
    image

@ltfschoen
Copy link
Contributor Author

Just tested, that looks pretty good! A couple comments:

  • Can we have this behavior that the menu stays displayed as long as the user doesn't click away? (no autoclose)
  • Could we use the same styling as the other menus for hovers (black on dark grey). Like
    image

@Tbaut I've pushed commits to address your review comments.

@Tbaut
Copy link
Collaborator

Tbaut commented Jan 14, 2019

  • Misunderstanding regarding the 3 dots sorry. I'm totally fine with them.
    I was talking about the styling of the menu items on hover (the list "backup account", "add token"). On mouse hover, instead of having the inverted colors + the animation, to simply have the same styling as what we have on other menus, without animation to keep things consistent e.g
    image
.header-nav a:hover, .header-nav a:link:hover, .header-nav a:visited:hover {
    background: rgba(221, 221, 221, 0.5);
    color: #222;
}

@ltfschoen
Copy link
Contributor Author

@Tbaut Sorry about that. I've pushed commits to address those comments (i.e. layer under menu to prevent clicking another link upon menu blur click, restore three dot icon and fix styling of menu including hover for consistency)

@Tbaut
Copy link
Collaborator

Tbaut commented Jan 15, 2019

  • I think it works well and looks good 🎉
  • Given the fact that the big PR (Signer) will be merged soon and they conflict (do not show a specific menu item for Signer account) I suggest that we wait and merge this one right after the big one, is that ok?

@Tbaut Tbaut added the A1-onice label Jan 15, 2019
@ltfschoen
Copy link
Contributor Author

  • I think it works well and looks good 🎉
  • Given the fact that the big PR (Signer) will be merged soon and they conflict (do not show a specific menu item for Signer account) I suggest that we wait and merge this one right after the big one, is that ok?

Yes sure, Signer is priority

@Tbaut Tbaut removed the A1-onice label Jan 15, 2019
@ltfschoen
Copy link
Contributor Author

@amaurymartiny I've pushed changes to address your review comments. I haven't had any success implementing Icon from semantic-ui. I've shared what I've tried but I could do with some help.

Copy link
Collaborator

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much cleaner! Will merge after the small nits are fixed.

];

if (this.isParitySignerAccount() === false) {
menuItems = [backupAccountItem, ...menuItems];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use unshift() here

onClick: () => history.push(`/backup/${address}`)
};

let menuItems = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above comment, this can be const

<div
className='popup-screen_item'
key={item.name}
onClick={() => item.onClick()}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onClick={item.onClick}

Copy link
Contributor

@axelchalon axelchalon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works well!

@ltfschoen
Copy link
Contributor Author

@amaurymartiny I've pushed commits addressing your latest comments. We can raise an issue to try and implement SUIIcon instead of using the svg's as you mentioned

Copy link
Collaborator

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one tiny small nit. Sometimes these shorthands don't work well, so @ltfschoen i would appreciate if you could quickly test it. If it works, feel free to merge this PR!

@ltfschoen ltfschoen merged commit d67f912 into master Jan 19, 2019
@ltfschoen ltfschoen deleted the luke-264-account-screen-menu-alternative branch January 19, 2019 13:46
@Tbaut
Copy link
Collaborator

Tbaut commented Jan 22, 2019

The clickaway behavior seems to have come back again after the changes. I opened an issue: #383

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants