You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Button.jsx 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import React from 'react'
  2. import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
  3. import { heightPercentageToDP as hp, widthPercentageToDP as wp } from "react-native-responsive-screen";
  4. export default Button = ({ onPress, title, style }) => {
  5. return (
  6. <TouchableOpacity
  7. onPress={onPress}
  8. style={[{ paddingHorizontal: hp("2.6%"), justifyContent: "space-between" }, styles.widgetBox, style]}
  9. >
  10. <View style={[styles.alignCenter, styles.row]}>
  11. <Text trunk={true} numberOfLines={2} style={{ color: "#4C5A81", fontSize: hp("2.3%"), textAlign: 'center' }}>{title}</Text>
  12. </View>
  13. </TouchableOpacity>
  14. );
  15. }
  16. const styles = StyleSheet.create({
  17. alignCenter: {
  18. alignItems: "center",
  19. },
  20. row: {
  21. flexDirection: "row",
  22. },
  23. text: {
  24. color: "#4C5A81",
  25. fontSize: hp("2.3%"),
  26. paddingLeft: wp("5%"),
  27. width: wp("60%"),
  28. },
  29. widgetBox: {
  30. backgroundColor: "#fff",
  31. borderRadius: wp("3%"),
  32. marginVertical: hp("1.3%"),
  33. paddingVertical: hp("2%"),
  34. position: "relative",
  35. flexDirection: "row",
  36. alignItems: "center",
  37. },
  38. });