import React from "react"; import {ActivityIndicator, StyleSheet, TouchableOpacity} from "react-native"; import {Color} from '../../config/Color'; import PropTypes from "prop-types"; import CustomText from "../CustomText"; import styles from "./styles"; export default function CustomButton(props) { const { style, styleCustomText, icon, outline, onPress, full, round, loading, children, ...rest } = props; return ( {icon ? icon : null} {children || "CustomButton"} {loading ? ( ) : null} ); } CustomButton.propTypes = { style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), icon: PropTypes.node, outline: PropTypes.bool, full: PropTypes.bool, onPress: PropTypes.func, round: PropTypes.bool, loading: PropTypes.bool }; CustomButton.defaultProps = { style: {}, icon: null, outline: false, full: false, onPress: () => { }, round: false, loading: false };