Last active
May 15, 2019 14:39
-
-
Save m4har/e03703d35916a2052abb17d548d101c7 to your computer and use it in GitHub Desktop.
component button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/components/Button/index.js | |
import React from "react"; | |
import { TouchableOpacity, Text } from "react-native"; | |
const Button = ({ onPress, style, title, ...props }) => ( | |
<TouchableOpacity | |
{...props} | |
onPress={onPress} | |
style={[styles.container, style]} | |
> | |
<Text style={styles.textTitle}>{title}</Text> | |
</TouchableOpacity> | |
); | |
export default Button; | |
const styles = { | |
container: { | |
flex: 1, | |
backgroundColor: "rgba(0,0,0,0.3)", | |
height: 50, | |
justifyContent: "center", | |
alignItems: "center", | |
borderRadius: 5, | |
borderWidth: 1 | |
}, | |
textTitle: { | |
color: "#fff" | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment