Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/scenes/components/menu/menu-showcase.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const MenuShowcase = (props: MenuShowcaseProps): MenuElement => {

const renderData: MenuElement[] = props.data.map((el, index) => (
el.subItems ? (
<MenuGroup key={index}>
<MenuGroup key={index} {...el}>
{el.subItems.map((el, index) => (
<MenuItem key={index} {...el} />
))}
Expand Down
33 changes: 32 additions & 1 deletion src/scenes/components/menu/type.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -13,6 +12,7 @@ interface MenuType {
title: string;
accessoryLeft?: (style: ImageStyle) => IconElement;
disabled?: boolean;
initialExpanded?: boolean;
}

export interface MenuShowcaseProps extends MenuProps {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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,
],
};

Expand Down