UNPKG

airbridge-react-native-sdk

Version:

Airbridge SDK for React Native

36 lines (30 loc) 752 B
import React, { Component } from 'react' import { Platform, Pressable, Image, } from 'react-native' export default class ImageButton extends Component{ constructor(props){ super(props) this.accessibilityLabel = Platform.OS !== 'ios' ? this.props.accessibilityLabel : null this.testID = this.props.accessibilityLabel } render() { return ( <Pressable testID={this.testID} accessibilityLabel={this.accessibilityLabel} onPress={this.props.onPress}> <Image style={{ padding: 12, margin: 12, width: this.props.width, height: this.props.height }} source={ this.props.source }/> </Pressable> ) } }