This commit is contained in:
Abin Toppo
2026-01-23 11:02:56 +05:30
parent 76ba2b66f7
commit 78a74472dd
19 changed files with 175 additions and 154 deletions
+1
View File
@@ -27,6 +27,7 @@ const LiveAuction = () => {
try {
setAllBoolean(prev => ({ ...prev, isLoading: true }))
const res = await apiCall<any>('get', `${GET_MY_AUCTION}`,);
if (res?.statusCode === 200) {
const purchasedIds = new Set(res.data.map((item: any) => item.auctionId));
const filteredLive = data?.result.map((item: any) => ({ ...item, active: !purchasedIds.has(item.auctionId) }));
+4 -3
View File
@@ -13,6 +13,7 @@ import moment from 'moment';
interface Props { visible: boolean; onClose: () => void; data?: any }
const AuctionFullDetail: React.FC<Props> = ({ visible, onClose, data }) => {
const inset = useSafeAreaInsets()
const { data: auctionData, isLoading } = useGetAuciton({ auctionId: data?.auctionId })
const [aucitonDetail, setAuciotnDetail] = useState<any>(auctionData)
@@ -52,10 +53,10 @@ const AuctionFullDetail: React.FC<Props> = ({ visible, onClose, data }) => {
const path = `${dirs.DownloadDir}/${fileName}.pdf`;
// console.log('Saving to:', path);
const downloadUrl = `${AUCTION_DOCUMENT_DOWNLOAD}?documentId=${id}&isAmendment=false`;
// console.log('Download URL:', downloadUrl);
const response = await ReactNativeBlobUtil.config({
fileCache: false,
@@ -163,7 +164,7 @@ const AuctionFullDetail: React.FC<Props> = ({ visible, onClose, data }) => {
<View style={[styles.iconCircle, { backgroundColor: '#fee2e2' }]}><Clock size={16} color="#ef4444" /></View>
<View>
<Text style={styles.label}>Purchase Deadline (End)</Text>
<Text style={styles.value}>{formatDate(data?.purchaseEnd)}</Text>
<Text style={styles.value}>{formatDate(data?.keyDates?.auctionPurchase?.startDateTime)}</Text>
</View>
</View>
</View>
@@ -41,10 +41,10 @@ const AuctionItemDetail: React.FC<Props> = ({ visible, onClose, data }) => {
const path = `${dirs.DownloadDir}/${fileName}.pdf`;
// console.log('Saving to:', path);
const downloadUrl = `${AUCTION_ITEM_DOCUMENT_DOWNLOAD}?auctionItemId=${id}`;
// console.log('Download URL:', downloadUrl);
const response = await ReactNativeBlobUtil.config({
fileCache: false,
@@ -142,7 +142,9 @@ const PurchaseAuctionList = () => {
);
purchaseListMutation({ auctionNumbers, contractorId: LoginUser.contractorId }, {
onSuccess: (res) => {
console.log("purchaseListMutation",res)
if (res.statusCode == 200) {
setList(res.data)
}
},
+8 -1
View File
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import { View, Text, StyleSheet, ScrollView, TouchableOpacity } from 'react-native';
import Animated, { FadeIn, FadeOut, Layout, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
import { ChevronDown, Trash2, Info } from 'lucide-react-native';
@@ -17,6 +17,13 @@ const PurchaseList = () => {
const toggleExpand = (index: number) => {
setExpandedIndex(prev => (prev === index ? null : index));
};
useEffect(() => {
if (!SelectedPurchaseList || SelectedPurchaseList.length < 1) {
Navigation.goBack();
}
}, [SelectedPurchaseList]);
return (
<View style={styles.screen}>