Bez popisu

Derechos.js 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import React from "react";
  2. import {
  3. View,
  4. Text,
  5. StyleSheet,
  6. TouchableOpacity,
  7. Linking,
  8. Pressable,
  9. } from "react-native";
  10. import { FlatList, TouchableHighlight } from "react-native-gesture-handler";
  11. import { ButtonLay } from "./components/Button.js";
  12. import Leyes from "./data/leyes.json";
  13. import LeyesPR from "./data/leyesPR.json";
  14. import DerechosAmb from "./data/derechos.json";
  15. const Derechos = () => {
  16. return (
  17. <>
  18. <View>
  19. <Text style={styles.container2}>1) Leyes de la Tierra</Text>
  20. <View >
  21. {Leyes.map(({id, title, link}) => {
  22. return (
  23. <>
  24. <TouchableOpacity
  25. style={styles.button}
  26. key={id}
  27. onPress={() => {
  28. Linking.openURL(link.toString());
  29. }}
  30. >
  31. <Text style={styles.text}>{title}</Text>
  32. </TouchableOpacity>
  33. </>
  34. );
  35. })}
  36. </View>
  37. </View>
  38. <View>
  39. <Text style={styles.container2}>
  40. 2) Derechos del activista climatico
  41. </Text>
  42. <View>
  43. {DerechosAmb.map(({id, title, link}) => {
  44. return (
  45. <>
  46. <TouchableOpacity
  47. style={styles.button}
  48. onPress={() => {
  49. Linking.openURL(link.toString());
  50. }}
  51. >
  52. <Text style={styles.text} key={id} >{title}</Text>
  53. </TouchableOpacity>
  54. </>
  55. );
  56. })}
  57. </View>
  58. </View>
  59. <View>
  60. <Text style={styles.container2}>3) Leyes de Puerto Rico</Text>
  61. <View>
  62. {LeyesPR.map(({id, title, link}) => {
  63. return (
  64. <>
  65. <TouchableOpacity
  66. style={styles.button}
  67. onPress={() => {
  68. Linking.openURL(link.toString());
  69. }}
  70. >
  71. <Text style={styles.text} key={id}>{title}</Text>
  72. </TouchableOpacity>
  73. </>
  74. );
  75. })}
  76. </View>
  77. </View>
  78. </>
  79. );
  80. };
  81. const styles = StyleSheet.create({
  82. container: {
  83. fontSize: 25,
  84. textAlign: "center",
  85. marginTop: "10%",
  86. },
  87. container2: {
  88. fontSize: 25,
  89. textAlign: "left",
  90. marginTop: "10%",
  91. marginLeft: "5%",
  92. },
  93. laws: {
  94. fontSize: 15,
  95. textAlign: "center",
  96. marginTop: "5%",
  97. },
  98. button: {
  99. width: 250,
  100. alignSelf: "center",
  101. alignItems: "center",
  102. justifyContent: "center",
  103. paddingVertical: 12,
  104. paddingHorizontal: 32,
  105. borderRadius: 4,
  106. elevation: 3,
  107. backgroundColor: "#009688",
  108. marginTop: "5%",
  109. },
  110. text: {
  111. fontSize: 16,
  112. lineHeight: 21,
  113. fontWeight: "bold",
  114. letterSpacing: 0.25,
  115. color: "white",
  116. textAlign: "center",
  117. },
  118. });
  119. export default Derechos;