native-widgets
Version:
The "native-widgets" npm package is designed to enhance the user interface development experience in React Native applications by providing a set of pre-designed native widgets or components. These components are built to closely mimic the native UI eleme
47 lines (41 loc) • 968 B
JavaScript
import React from 'react'
import { TouchableOpacity, Text, View } from 'react-native'
import { COLOR_SECONDARY } from '../../../utils/colors'
import { styles } from './styles'
/**
*
* @param {*} props
* @returns
*/
const CustomButton = (props) => {
const {
buttonStyle,
onPress,
text = 'Continue',
textStyle,
activeOpacity = 0.5,
buttonDisabled = false,
height = 50,
buttonColor = '',
} = props || {}
const combinedStyle = {
...styles.touchableHighlight(buttonColor),
height: height,
}
return (
<>
<TouchableOpacity
disabled={buttonDisabled}
onPress={onPress}
underlayColor={COLOR_SECONDARY}
style={[combinedStyle, buttonStyle]}
activeOpacity={activeOpacity}
>
<View style={styles.ButtonActivity}>
<Text style={[styles.text, textStyle]}>{text}</Text>
</View>
</TouchableOpacity>
</>
)
}
export default CustomButton