mortimel.ojeda 2 роки тому
джерело
коміт
568d6aec43
1 змінених файлів з 15 додано та 0 видалено
  1. 15
    0
      CustomButton.js

+ 15
- 0
CustomButton.js Переглянути файл

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