coinforbarter-react-native
Version:
CoinForBarter ReactNative Library - Integrate cryptocurrency payments for goods and services in your Mobile App
26 lines (25 loc) • 1.08 kB
JavaScript
import React from 'react';
import { TouchableOpacity, Text } from 'react-native';
import tw from 'tailwind-react-native-classnames';
import { CoinForBarterButton } from './style';
export const Button = ({ children, onClick, isValid = true, isRed, }) => {
if (!isValid) {
return (<TouchableOpacity onPress={onClick}>
<Text style={Object.assign(Object.assign({}, tw `py-2 px-4 w-full text-sm shadow font-bold text-center`), CoinForBarterButton.Invalid)}>
{children}
</Text>
</TouchableOpacity>);
}
if (isRed) {
return (<TouchableOpacity onPress={onClick}>
<Text style={Object.assign(Object.assign({}, tw `text-center py-2 px-4 w-full text-sm font-bold`), CoinForBarterButton.Red)}>
{children}
</Text>
</TouchableOpacity>);
}
return (<TouchableOpacity onPress={onClick}>
<Text style={Object.assign(Object.assign({}, tw `text-center py-2 px-4 w-full text-sm font-bold`), CoinForBarterButton.Valid)}>
{children}
</Text>
</TouchableOpacity>);
};