Aucune description

loggedIn.js 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import * as React from 'react';
  2. import { Alert, View, Linking} from 'react-native';
  3. import { Button, Text, TextInput, Divider } from 'react-native-paper';
  4. import { useCallback } from "react";
  5. import { createStackNavigator, createAppContainer } from 'react-navigation';
  6. const supportedURL = "https://docs.google.com/forms/d/e/1FAIpQLSe93-cuCFQ084AxVbzhwFJHjtPhrXFJ624ezAcqKU5qUsBqwg/viewform";
  7. const OpenURLButton = ({ url, children }) => {
  8. const handlePress = useCallback(async () => {
  9. // Checking if the link is supported for links with custom URL scheme.
  10. const supported = await Linking.canOpenURL(url);
  11. if (supported) {
  12. // Opening the link with some app, if the URL scheme is "http" the web link should be opened
  13. // by some browser in the mobile
  14. await Linking.openURL(url);
  15. } else {
  16. Alert.alert(`Don't know how to open this URL: ${url}`);
  17. }
  18. }, [url]);
  19. return <Button buttonColor = "purple"
  20. textColor= "white"
  21. style={{width: 250, marginVertical: 40, marginHorizontal: 90}}
  22. onPress={handlePress}>
  23. Llenar formulario de voluntario
  24. </Button> ;
  25. };
  26. const MyComponent = () => {
  27. const [text, setText] = React.useState("");
  28. const [text2, setText2] = React.useState("");
  29. return (
  30. <View >
  31. <Text style={{fontSize:30, fontWeight:"bold", marginVertical: 20, marginHorizontal: 30}}>
  32. Mi Cuenta
  33. </Text>
  34. <Text style={{fontSize:15, fontWeight:"bold", marginVertical: 20, marginHorizontal: 30}}>
  35. Nombre:
  36. </Text>
  37. <Text style={{fontSize:15, fontWeight:"bold", marginVertical: 20, marginHorizontal: 30}}>
  38. Email:
  39. </Text>
  40. <Text style={{fontSize:15, fontWeight:"bold", marginVertical: 20, marginHorizontal: 30}}>
  41. Teléfono:
  42. </Text>
  43. <OpenURLButton
  44. url={"https://docs.google.com/forms/d/e/1FAIpQLSe93-cuCFQ084AxVbzhwFJHjtPhrXFJ624ezAcqKU5qUsBqwg/viewform"}>
  45. Llenar formulario de voluntario
  46. </OpenURLButton>
  47. </View>
  48. );
  49. };
  50. export default MyComponent;