diff --git a/src/scenes/components/menu/menu-showcase.component.tsx b/src/scenes/components/menu/menu-showcase.component.tsx index 3d7b07c2..97a4153e 100644 --- a/src/scenes/components/menu/menu-showcase.component.tsx +++ b/src/scenes/components/menu/menu-showcase.component.tsx @@ -12,7 +12,7 @@ export const MenuShowcase = (props: MenuShowcaseProps): MenuElement => { const renderData: MenuElement[] = props.data.map((el, index) => ( el.subItems ? ( - + {el.subItems.map((el, index) => ( ))} diff --git a/src/scenes/components/menu/type.tsx b/src/scenes/components/menu/type.tsx index c11fc6b6..f74a7f96 100644 --- a/src/scenes/components/menu/type.tsx +++ b/src/scenes/components/menu/type.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { ImageStyle } from 'react-native' import { IconElement, MenuProps } from '@ui-kitten/components'; import { StarIcon } from '../../../components/icons'; @@ -13,6 +12,7 @@ interface MenuType { title: string; accessoryLeft?: (style: ImageStyle) => IconElement; disabled?: boolean; + initialExpanded?: boolean; } export interface MenuShowcaseProps extends MenuProps { @@ -90,6 +90,29 @@ const withGroupsMenuItems: MenuGroupType[] = [ }, ]; +const withGroupsExpandedMenuItems: MenuGroupType[] = [ + { + title: 'Item 1', + accessoryLeft: StarIcon, + initialExpanded: true, + subItems: [ + { + title: 'Item 11', + accessoryLeft: StarIcon, + disabled: true, + }, + { + title: 'Item 12', + accessoryLeft: StarIcon, + }, + { + title: 'Item 13', + accessoryLeft: StarIcon, + }, + ], + } +]; + const defaultMenu: ComponentShowcaseItem = { title: 'Default', props: { @@ -127,10 +150,18 @@ const withGroupsMenu: ComponentShowcaseItem = { }, }; +const withExpandedGroupsMenu: ComponentShowcaseItem = { + title: 'Default expand', + props: { + data: withGroupsExpandedMenuItems, + }, +}; + const withGroupsSection: ComponentShowcaseSection = { title: 'With Groups', items: [ withGroupsMenu, + withExpandedGroupsMenu, ], };