import React from 'react'; import { StyleSheet, Text, TouchableHighlight, View, ActivityIndicator, TouchableHighlightProps, ViewStyle, } from 'react-native'; import Colors from '../constants/Colors'; interface Props extends TouchableHighlightProps { disabled?: boolean; loading?: boolean; title?: string; buttonStyle?: ViewStyle; } const Button: React.FunctionComponent = ({ disabled, loading, title, onPress, onPressIn, style, buttonStyle, children, }) => ( {children || ( loading ? : {title} )} ); const styles = StyleSheet.create({ container: { alignItems: 'center', justifyContent: 'center', }, button: { alignItems: 'center', justifyContent: 'center', borderRadius: 3, paddingVertical: 8, paddingHorizontal: 12, backgroundColor: Colors.tintColor, }, disabledButton: { backgroundColor: Colors.disabled, }, label: { color: '#ffffff', fontWeight: '700', }, }); export default Button;