-
Notifications
You must be signed in to change notification settings - Fork 3k
/
Copy pathmenuItemPropTypes.js
68 lines (47 loc) · 2.03 KB
/
menuItemPropTypes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import PropTypes from 'prop-types';
import CONST from '../CONST';
import stylePropTypes from '../styles/stylePropTypes';
const propTypes = {
/** Text to be shown as badge near the right end. */
badgeText: PropTypes.string,
/** Any additional styles to apply */
// eslint-disable-next-line react/forbid-prop-types
wrapperStyle: stylePropTypes,
/** Function to fire when component is pressed */
onPress: PropTypes.func,
/** Icon to display on the left side of component */
icon: PropTypes.oneOfType([PropTypes.elementType, PropTypes.string]),
/** Icon Width */
iconWidth: PropTypes.number,
/** Icon Height */
iconHeight: PropTypes.number,
/** Text to display for the item */
title: PropTypes.string.isRequired,
/** Boolean whether to display the right icon */
shouldShowRightIcon: PropTypes.bool,
/** Should we make this selectable with a checkbox */
shouldShowSelectedState: PropTypes.bool,
/** Whether this item is selected */
isSelected: PropTypes.bool,
/** A boolean flag that gives the icon a green fill if true */
success: PropTypes.bool,
/** Overrides the icon for shouldShowRightIcon */
iconRight: PropTypes.elementType,
/** A description text to show under the title */
description: PropTypes.string,
/** Any additional styles to pass to the icon container. */
iconStyles: PropTypes.arrayOf(PropTypes.object),
/** The fill color to pass into the icon. */
iconFill: PropTypes.string,
/** Whether item is focused or active */
focused: PropTypes.bool,
/** Should we disable this menu item? */
disabled: PropTypes.bool,
/** A right-aligned subtitle for this menu option */
subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
/** Flag to choose between avatar image or an icon */
iconType: PropTypes.oneOf([CONST.ICON_TYPE_AVATAR, CONST.ICON_TYPE_ICON]),
/** Whether the menu item should be interactive at all */
interactive: PropTypes.bool,
};
export default propTypes;