Без опису

123456789101112131415
  1. import React from 'react';
  2. import { Text, TouchableOpacity } from 'react-native';
  3. import { styles } from '../config/styles';
  4. import colors from '../config/colors';
  5. function CustomButton( {title, onPress, color = "skyblue", marginTop} ) {
  6. return (
  7. <TouchableOpacity style={[styles.regbutton, { backgroundColor: colors[color] }, { marginTop: marginTop }]} onPress={onPress}>
  8. <Text style={styles.regbuttontext}>{title}</Text>
  9. </TouchableOpacity>
  10. );
  11. }
  12. export default CustomButton;