Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RN: Add accessibility labels to OnDeviceUI #1780

Merged
merged 2 commits into from
Sep 6, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 10 additions & 2 deletions app/react-native/src/preview/components/OnDeviceUI/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ export default class OnDeviceUI extends Component {
<Animated.View style={menuSpacerStyles} />
<View style={style.previewContainer}>
<Animated.View style={headerStyles}>
<TouchableWithoutFeedback onPress={this.menuToggledHandler}>
<TouchableWithoutFeedback
onPress={this.menuToggledHandler}
testID='Storybook.OnDeviceUI.open'
accessibilityLabel='Storybook.OnDeviceUI.open'
>
<View>
<Image source={openIcon} style={style.icon} />
</View>
Expand All @@ -140,7 +144,11 @@ export default class OnDeviceUI extends Component {
</View>
</View>
<Animated.View style={menuStyles} onLayout={this.menuLayoutHandler}>
<TouchableWithoutFeedback onPress={this.menuToggledHandler}>
<TouchableWithoutFeedback
onPress={this.menuToggledHandler}
testID='Storybook.OnDeviceUI.close'
accessibilityLabel='Storybook.OnDeviceUI.close'
>
<View style={style.closeButton}>
<Image source={closeIcon} style={style.icon} />
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ SectionHeader.propTypes = {
};

const ListItem = ({ title, selected, onPress }) =>
<TouchableOpacity key={title} style={style.item} onPress={onPress}>
<TouchableOpacity
key={title}
style={style.item}
onPress={onPress}
testID={`Storybook.ListItem.${title}`}
accessibilityLabel={`Storybook.ListItem.${title}`}
>
<Text style={[style.itemText, selected && style.itemTextSelected]}>
{title}
</Text>
Expand Down