Skip to content

Instantly share code, notes, and snippets.

@dcortesnet
Created February 10, 2023 14:59
Show Gist options
  • Select an option

  • Save dcortesnet/2ed3f89ebb51027c323194f67e869966 to your computer and use it in GitHub Desktop.

Select an option

Save dcortesnet/2ed3f89ebb51027c323194f67e869966 to your computer and use it in GitHub Desktop.
React native Google button
import React from "react";
import { Image, StyleSheet, Text, TouchableOpacity } from "react-native";
interface Props {
text: string;
onPress: any;
width: string;
}
const GoogleButton: React.FC<Props> = ({ text, onPress, width }) => {
return (
<TouchableOpacity
style={[styles.button, { width: width }]}
onPress={onPress}
>
<Image source={require("../assets/google-logo.png")}></Image>
<Text style={styles.text}>{text}</Text>
</TouchableOpacity>
);
};
const styles = StyleSheet.create({
button: {
borderRadius: 10,
borderWidth: 1,
borderColor: "#EAEAEA",
backgroundColor: "white",
display: "flex",
flexDirection: "row",
justifyContent: "center",
alignItems: "center",
padding: 10,
},
text: {
paddingLeft: 15,
color: "#6F6F6F",
fontWeight: "500",
},
});
export default GoogleButton;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment