import { StatusBar } from 'expo-status-bar'; import { useEffect, useState } from 'react'; import React from 'react'; import { StyleSheet, Text, View, Image, ImageBackground, Button, TouchableOpacity, Platform, Alert, FlatList} from 'react-native'; import { ScrollView } from 'react-native-gesture-handler'; TouchableOpacity.defaultProps = { activeOpacity: 0.8 }; export default function Listas ({ navigation }) { const [data, setData] = useState([]); useEffect(() => { fetch('https://ada.uprrp.edu/~victor.hernandez17/groceryPolice/viewListProducts.php', { method: 'POST', mode: 'no-cors', headers: { Accept: 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringify({ lid: navigation.getParam('lid') }) }) .then((response) => response.json()) .then((json) => { setData(json); console.log(json); }) .catch((error) => { console.error(error); }); }, []); return ( { navigation.getParam('name_l') } { navigation.getParam('store') } list.id} renderItem={({ item }) => ( {item.name_p} )} /> navigation.navigate('NewProduct', { lid:navigation.getParam('lid')})}> + ); }; // navigation.getParam('lid') // STYLING const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#F2F2F2', }, pageTitleView: { flex: 1, alignContent: 'flex-end', justifyContent: 'flex-end' }, contents: { flex: 2, }, contentsPlus: { flex: 1, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }, pageTitleText: { color: '#888', fontSize: 35, paddingLeft: 10, paddingBottom: -10, fontFamily: 'Avenir' }, location: { color: 'rgb(32,56,100)', fontSize: 25, paddingLeft: 15, paddingBottom: 30, fontFamily: 'Avenir' }, listCards: { flexDirection: 'row', alignContent: 'flex-start', justifyContent: 'flex-start', alignItems: 'center', backgroundColor: 'rgb(32,56,100)', width: '99%', borderRadius: 10, paddingVertical: 20, paddingHorizontal: 10, marginBottom: 10, shadowColor: 'rgba(0,0,0,.5)', shadowOffset: { width: 2, height: 2}, shadowOpacity: 0.3, }, listText: { color: 'white', fontSize: 20, fontFamily: 'Avenir' }, plusButton: { flexDirection: 'row', alignContent: 'flex-start', justifyContent: 'flex-start', alignItems: 'center', justifyContent: 'center', backgroundColor: 'rgb(32,56,100)', width: 90, height: 90, borderRadius: 45, marginBottom: 50, shadowColor: 'rgba(0,0,0,.5)', shadowOffset: { width: 2, height: 2}, shadowOpacity: 0.3, }, plusText: { color: '#F2F2F2', fontSize: 60, fontWeight: '600', fontFamily: 'Avenir' }, appButtonText: { fontSize: 17, color: "#fff", alignSelf: "center", }, bContainer: { padding: 50, paddingTop: -20, flex: 2, width: '100%', justifyContent: "space-evenly", }, scrollView: { backgroundColor: 'transparent', marginHorizontal: 20, }, });