import React from 'react'; import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'; import { RectButton } from 'react-native-gesture-handler'; import { isBright } from './utils'; interface ButtonProps { onPress: () => void; color?: string; style?: StyleProp; } const Button: React.FC = ({ children, onPress, color, style }) => { const containerStyle = [ styles.container, { backgroundColor: color || '#232323', }, style, ]; const buttonStyle = [ styles.button, { backgroundColor: color ? isBright(color) ? '#000000b0' : '#ffffffb0' : '', borderColor: color, }, style, ]; return ( {children} ); }; const styles = StyleSheet.create({ container: { borderRadius: 25, elevation: 3, }, button: { borderRadius: 25, height: 50, width: 50, borderWidth: StyleSheet.hairlineWidth, justifyContent: 'center', alignItems: 'center', }, }); export default Button;