Skip to content

Instantly share code, notes, and snippets.

@JoBerkner
Created July 31, 2020 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoBerkner/7d9b5e75dbad592458be1777f9a4616a to your computer and use it in GitHub Desktop.
Save JoBerkner/7d9b5e75dbad592458be1777f9a4616a to your computer and use it in GitHub Desktop.
code of a button component
import React from "react";
import { View, Text, StyleSheet, TouchableOpacity, Animated } from "react-native";
const Button = props => {
return (
<Animated.View style={props.buttonStyle}>
<TouchableOpacity onPress={props.onPress}>
<Text style={styles.text}>{props.text}</Text>
</TouchableOpacity>
</Animated.View>
);
};
const styles = StyleSheet.create({
text: {
textAlign: "center",
fontSize: 12,
color: COLORS.red,
borderRadius: 50,
backgroundColor: "#323b44",
padding: 50,
fontWeight: "bold"
}
});
export default Button;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment