Files
react-native-fast-image/ReactNativeFastImageExample/src/Button.tsx
T

34 lines
733 B
TypeScript
Raw Normal View History

2018-09-23 18:40:18 -04:00
import React from 'react'
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'
2020-03-12 02:27:37 -04:00
interface ButtonProps {
text: string
onPress: () => void
}
const Button = ({ text, onPress }: ButtonProps) => (
2018-09-23 18:40:18 -04:00
<TouchableOpacity onPress={onPress}>
<View style={styles.button}>
<Text style={styles.text}>{text}</Text>
</View>
</TouchableOpacity>
)
const styles = StyleSheet.create({
button: {
backgroundColor: 'black',
margin: 10,
height: 44,
paddingLeft: 10,
paddingRight: 10,
borderRadius: 10,
alignItems: 'center',
justifyContent: 'center',
},
text: {
color: 'white',
},
})
export default Button