atrilabs-engine icon indicating copy to clipboard operation
atrilabs-engine copied to clipboard

Add a Vertical Menu Component

Open cruxcode opened this issue 3 years ago • 7 comments

A vertical menu component that works as shown here.

Here is the component Signature

export type MenuItemType = {
  key: string;
  label: string;
  type: "menuitem";
  children: (SubMenuType | MenuItemGroupType)[];
};

export type SubMenuType = {
  key: string;
  label: string;
  children: (SubMenuType | MenuItemGroupType)[];
  type: "submenu";
};

export type MenuItemGroupType = {
  key: string;
  label: string;
  children: { key: string; label: string }[];
  type: "group";
};

export type ItemType = MenuItemType | SubMenuType | MenuItemGroupType;

export type VerticalMenuProps = {
  styles: React.CSSProperties;
  custom: {
   items: ItemType[];
  };
};

// replace the body of this function with your code
export const VerticalMenu: React.FC<VerticalMenuProps> = React.forwardRef((ref, props) => {
  return <div></div>;
})

cruxcode avatar Sep 15 '22 06:09 cruxcode

@cruxcode Plz assign me for this issue

Jitulteron7 avatar Sep 15 '22 07:09 Jitulteron7

The top-most menu items are called MenuItemType. A MenuItemType can have children of type SubMenuType or MenuItemGroupType. The difference between the two is that SubMenuType is collapsable while MenuItemGroupType are not collapsable.

cruxcode avatar Sep 15 '22 07:09 cruxcode

@cruxcode Plz assign me for this issue

I have updated the signature. Please have a look at it again.

cruxcode avatar Sep 15 '22 08:09 cruxcode

Relevant discussions for this issue https://github.com/Atri-Labs/atrilabs-engine/discussions/169 https://github.com/Atri-Labs/atrilabs-engine/discussions/184 https://github.com/Atri-Labs/atrilabs-engine/discussions/180 https://github.com/Atri-Labs/atrilabs-engine/discussions/186 https://github.com/Atri-Labs/atrilabs-engine/discussions/187

cruxcode avatar Sep 15 '22 10:09 cruxcode

thank you

Jitulteron7 avatar Sep 16 '22 05:09 Jitulteron7

@all-contributors please add @arjundubey-cr for userTesting

darshitac11 avatar Oct 09 '22 10:10 darshitac11

@darshitac11

I've put up a pull request to add @arjundubey-cr! :tada:

allcontributors[bot] avatar Oct 09 '22 10:10 allcontributors[bot]