34 lines
731 B
JavaScript
34 lines
731 B
JavaScript
import React from "react";
|
|
import { Text, StyleSheet, Pressable } from "react-native";
|
|
|
|
export default function Button(props) {
|
|
const { onPress, title = "Save", color = "black" } = props;
|
|
return (
|
|
<Pressable
|
|
style={[styles.button, { backgroundColor: color }]}
|
|
onPress={onPress}
|
|
>
|
|
<Text style={styles.text}>{title}</Text>
|
|
</Pressable>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
button: {
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
paddingVertical: 12,
|
|
paddingHorizontal: 32,
|
|
borderRadius: 4,
|
|
elevation: 3,
|
|
backgroundColor: "black",
|
|
},
|
|
text: {
|
|
fontSize: 16,
|
|
lineHeight: 21,
|
|
fontWeight: "bold",
|
|
letterSpacing: 0.25,
|
|
color: "white",
|
|
},
|
|
});
|