import React from 'react';
import { Text, TouchableOpacity } from 'react-native';

import { styles } from '../config/styles';
import colors from '../config/colors';

function CustomButton( {title, onPress, color = "skyblue", marginTop} ) {
    return (
        <TouchableOpacity style={[styles.regbutton, { backgroundColor: colors[color] }, { marginTop: marginTop }]} onPress={onPress}>
            <Text style={styles.regbuttontext}>{title}</Text>
        </TouchableOpacity>
    );
}

export default CustomButton;