antd#SubMenuProps TypeScript Examples

The following examples show how to use antd#SubMenuProps. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AddonsMenu.tsx    From jmix-frontend with Apache License 2.0 6 votes vote down vote up
function transformAddonItemToJsx(
  itemInfo: AddonItem<JmixMenuItemProps, JmixSubMenuItemProps>,
  extProps: AddonsMenuProps = {}
): JSX.Element {
  if (itemInfo.type === "MenuItem") {
    const {menuItemProps} = itemInfo;
    return (
      <MenuItem
        {...(extProps as MenuItemProps)}
        {...menuItemProps}
        icon={menuItemProps.icon ?? <BarsOutlined />}
        eventKey={menuItemProps.key}
      />
    )
  }

  const {childItems, subMenuItemProps} = itemInfo;
  return (
    <SubMenuItem
      {...(extProps as SubMenuProps)}
      {...subMenuItemProps}
    >
      {
        childItems.map((item: AddonItem) => {
          return transformAddonItemToJsx(item)
        })
      }
    </SubMenuItem>
  )
}
Example #2
Source File: AntdSubMenuWrapper.tsx    From dendron with GNU Affero General Public License v3.0 5 votes vote down vote up
function AntdSubmenuWrapper(props: SubMenuProps) {
  return <SubMenu {...props} />;
}