Няма описание

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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: 110}}>
  32. Crear Cuenta
  33. </Text>
  34. <TextInput style={{width: 350, marginVertical: 40, marginHorizontal: 30}}
  35. label="Nombre"
  36. value={text}
  37. mode = "outlined"
  38. outlineColor='#327ABC'
  39. onChangeText={text => setText(text)}
  40. />
  41. <TextInput style={{width: 350, marginVertical: -20, marginHorizontal: 30}}
  42. label="Email"
  43. value={text2}
  44. mode = "outlined"
  45. outlineColor='#327ABC'
  46. onChangeText={text2 => setText2(text2)}
  47. />
  48. <Button style={{width: 250, marginVertical: 70, marginHorizontal: 90}}
  49. buttonColor = "#327ABC"
  50. mode="contained"
  51. onPress={console.log(text)}>
  52. Crear cuenta
  53. </Button>
  54. <Divider style={{marginVertical: -20}}
  55. horizontalInset='true' />
  56. <Button style={{width: 250, marginVertical: 70, marginHorizontal: 90}}
  57. buttonColor = "teal"
  58. mode="contained" >
  59. Crear cuenta con Google
  60. </Button>
  61. </View>
  62. );
  63. };
  64. export default MyComponent;