Sin descripción

HomeScreen.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { propertiesListToString } from "@expo/config-plugins/build/android/Properties";
  2. import React, { useEffect, useState }from "react";
  3. import { StyleSheet, View, Text, Button } from 'react-native';
  4. import { globalStyles } from "../styles/global";
  5. export default App = ({ navigation }) => {
  6. {/*
  7. const [PIN, setPIN] = useState([]); // this is looking for 'PIN' and it's content
  8. // this connects us to the API and fetches the json file with the mociones
  9. const getMociones = async () => {
  10. try {
  11. const response = await fetch('http://10.0.0.65:5000/send?PIN=894761'); // connection to the website
  12. const json = await response.json();
  13. // setting the content of each category
  14. setPIN(json.PIN);
  15. } catch (error) {
  16. console.error(error);
  17. }
  18. }
  19. */}
  20. const pressHandler = () => {
  21. navigation.navigate('Pinpage');
  22. }
  23. {/*
  24. useEffect(() => {
  25. getMociones();
  26. }, []);
  27. */}
  28. return (
  29. <View style = {globalStyles.container}>
  30. <Text style = {globalStyles.tittleText}>Home Screen</Text>
  31. <Button title="go to pin page" onPress={pressHandler}/>
  32. </View>
  33. )
  34. }