hmcts / frontend

HMCTS Frontend contains the code you need to start building a user interface for HMCTS government services.
2 stars 9 forks source link

Extend Identity Bar to be able to have multiple menus (and types) #58

Closed adamsilver closed 5 years ago

adamsilver commented 5 years ago

Currently the Identity Bar has a flat list of actions that can be presented either in a row or all behind a toggle menu.

But let's say we had 5 actions. 2 are frequently used and 3 less so. It might make sense to expose the 2 frequently used actions and hide the rest behind a menu.

PRIMARY ACTION 1 | PRIMARY ACTION 2 | MORE ACTIONS MENU

In this case we'd need a Toggle Menu to be applied to 3 of the 5 buttons.

To do this two things need to happen.

  1. The macro/html need to be able to create groups of buttons.

<div class="g1"><button1><button2></div><div class="g2"><button3><button4><button5></div>

  1. Then you can use the Menu JS component to target “g2” (group 2) to turn it into a Menu while leaving the first group (g1) alone laid out in a row.

new HMCTSFrontend.Menu(target g2 etc)

adamsilver commented 5 years ago

Fied in release v0.0.25-alpha