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

#3102 add accessibility role and label to close button #3351

Merged
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
8 changes: 7 additions & 1 deletion src/components/HeaderWithCloseButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import styles from '../styles/styles';
import Header from './Header';
import Icon from './Icon';
import {Close, Download, BackArrow} from './Icon/Expensicons';
import compose from '../libs/compose';
import withLocalize, {withLocalizePropTypes} from './withLocalize';

const propTypes = {
/** Title of the Header */
Expand All @@ -29,6 +31,8 @@ const propTypes = {

/** Whether we should show a download button */
shouldShowDownloadButton: PropTypes.bool,

...withLocalizePropTypes,
};

const defaultProps = {
Expand Down Expand Up @@ -76,6 +80,8 @@ const HeaderWithCloseButton = props => (
<TouchableOpacity
onPress={props.onCloseButtonPress}
style={[styles.touchableButtonImage]}
accessibilityRole="button"
accessibilityLabel={props.translate('common.close')}
>
<Icon src={Close} />
</TouchableOpacity>
Expand All @@ -88,4 +94,4 @@ HeaderWithCloseButton.propTypes = propTypes;
HeaderWithCloseButton.defaultProps = defaultProps;
HeaderWithCloseButton.displayName = 'HeaderWithCloseButton';

export default HeaderWithCloseButton;
export default compose(withLocalize)(HeaderWithCloseButton);
1 change: 1 addition & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default {
delete: 'Delete',
contacts: 'Contacts',
recents: 'Recents',
close: 'Close',
},
attachmentPicker: {
cameraPermissionRequired: 'Camera Permission Required',
Expand Down
2 changes: 2 additions & 0 deletions src/pages/iou/IOUModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ class IOUModal extends Component {
<TouchableOpacity
onPress={() => Navigation.dismissModal()}
style={[styles.touchableButtonImage]}
accessibilityRole="button"
accessibilityLabel={this.props.translate('common.close')}
>
<Icon src={Close} />
</TouchableOpacity>
Expand Down