Skip to content
Merged
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
16 changes: 15 additions & 1 deletion src/components/Drawer/DrawerItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ type Props = {
* Function to execute on press.
*/
onPress?: () => void;
/**
* Accessibility label for the button. This is read by the screen reader when the user taps the button.
*/
accessibilityLabel?: string;
style?: StyleProp<ViewStyle>;
/**
* @optional
Expand All @@ -50,7 +54,16 @@ class DrawerItem extends React.Component<Props> {
static displayName = 'Drawer.Item';

render() {
const { icon, label, active, theme, style, onPress, ...rest } = this.props;
const {
icon,
label,
active,
theme,
style,
onPress,
accessibilityLabel,
...rest
} = this.props;
const { colors, roundness } = theme;
const backgroundColor = active
? color(colors.primary)
Expand Down Expand Up @@ -85,6 +98,7 @@ class DrawerItem extends React.Component<Props> {
accessibilityComponentType="button"
accessibilityRole="button"
accessibilityStates={active ? ['selected'] : []}
accessibilityLabel={accessibilityLabel}
>
<View style={styles.wrapper}>
{icon ? (
Expand Down