timelessco / chakra-components

Components built on top of Chakra UI
MIT License
1 stars 0 forks source link

refactor(submenu mode vertical or horizontal added): submenu mode #50

Closed govindsingh55 closed 4 years ago

govindsingh55 commented 4 years ago

submenu mode vertical or horizontal added

navin-moorthy commented 4 years ago

@govindsingh55, I saw your implementation. Progressing good, the mode prop should be for MenuBar, not the SubMenu.

image

Now the SubMenu is Vertical and outside PopOver, but the MenuBarItems are still horizontal.

We need the MenuBarItems as-well in Vertical like this,

image

govindsingh55 commented 4 years ago

@govindsingh55, I saw your implementation. Progressing good, the mode prop should be for MenuBar, not the SubMenu.

add the flexDirection="column" to the MenuBar

navin-moorthy commented 4 years ago

Adding flexDirection="column" to the MenuBar should be done in the component based on the mode prop.

govindsingh55 commented 4 years ago

but will it contradict when the menubar is vertical one but we want the submenu to open in popper?

navin-moorthy commented 4 years ago

No that will not contradict that, default behavior on mode=vertical makes menubar flexdirection column and the submenu still remains popper but the Popper placement: right. Also, when isCollapsable only on mode=vertical, then instead of popper another component for the collapsed item will be rendered. Understood?

govindsingh55 commented 4 years ago

I am not considering the navbar or hamburger case. In the case of side menubar, submenu can be a popover or collapsable container right?

navin-moorthy commented 4 years ago

yeah @govindsingh55 , even I am not considering the navbar. Yes. in case of side menubar, submenu can be popover by default but on isCollapsable it becomes a collapsable container. That's correct.

govindsingh55 commented 4 years ago

so isCollapsable prop will decide to popper or collapsable container.

navin-moorthy commented 4 years ago

so isCollapsable prop will decide to popper or collapsable container.

Correct 💯

navin-moorthy commented 4 years ago

Great work Bro. Still missing the context and trigger code from [here](https://github.com/timelessco/chakra-components/blob/refractor-menubar/packages/chakra-components/src/MenuBar/SubMenu.js Kindly add that.