|
|
|
@ -1,17 +1,18 @@
|
|
|
|
|
import { useEffect, useState } from 'react'
|
|
|
|
|
import { useContext, useEffect, useState } from 'react'
|
|
|
|
|
import { FlatList, RefreshControl, Text, View } from 'react-native'
|
|
|
|
|
import { useNavigation } from '@react-navigation/native';
|
|
|
|
|
import { Card } from '../../components/Card'
|
|
|
|
|
import { CardList } from '../../components/cardList/CardList'
|
|
|
|
|
import { Button } from '../../components/Button'
|
|
|
|
|
import { useFetchWithAuth } from '../../hooks/useFetchWithAuth'
|
|
|
|
|
import { SalesOrderContext } from './SalesOrderContex';
|
|
|
|
|
|
|
|
|
|
export const SalesOrderListScreen = () => {
|
|
|
|
|
const navigation = useNavigation();
|
|
|
|
|
const [refreshing, setRefreshing] = useState(false);
|
|
|
|
|
const endpoints = "pedido";
|
|
|
|
|
let defaultData: [] = [];
|
|
|
|
|
|
|
|
|
|
const { setLines } = useContext(SalesOrderContext);
|
|
|
|
|
const [entities, setEntities] = useState(defaultData);
|
|
|
|
|
|
|
|
|
|
const getInitData = async () => {
|
|
|
|
@ -39,7 +40,10 @@ export const SalesOrderListScreen = () => {
|
|
|
|
|
<Button
|
|
|
|
|
title=' + '
|
|
|
|
|
additionalStyle='z-10 absolute bottom-2 right-0'
|
|
|
|
|
onPress={() => navigation.navigate("SalesOrderFormScreen" as never)} />
|
|
|
|
|
onPress={() => {
|
|
|
|
|
setLines([]);
|
|
|
|
|
navigation.navigate("SalesOrderFormScreen" as never)}
|
|
|
|
|
} />
|
|
|
|
|
<FlatList
|
|
|
|
|
refreshControl={
|
|
|
|
|
<RefreshControl
|
|
|
|
|