Merge branch 'etender' of https://git.zeptic.in/rohit/Procurelinc into dev

This commit is contained in:
Abin Toppo
2026-01-14 13:37:24 +05:30
9 changed files with 439 additions and 12774 deletions
+54 -26
View File
@@ -1,27 +1,36 @@
import { StyleSheet, Text, View, ScrollView, TouchableOpacity } from 'react-native';
import React from 'react';
import { InsideHeader } from '../../Component/Index';
import colors from '../../Constant/Color';
import { useNavigation, useRoute } from '@react-navigation/native';
import { useProceedToBid } from '../../Services/BBPS/Hooks';
import { format } from '../../Helper/DateFormat';
import FontsFamily from '../../Constant/FontsFamily';
import { StyleSheet, Text, View, ScrollView, StatusBar, TouchableOpacity, RefreshControl } from 'react-native'
import React, { useEffect } from 'react'
import { InsideHeader } from '../../Component/Index'
import colors from '../../Constant/Color'
import { useNavigation, useRoute } from '@react-navigation/native'
import { useFetchTenderById, useProceedToBid } from '../../Services/BBPS/Hooks'
import FontsFamily from '../../Constant/FontsFamily'
const ProceedToBidDetail = () => {
const route: any = useRoute();
const tenderData = route.params?.tender;
const navigation = useNavigation<any>();
const { data, refetch } = useProceedToBid(tenderData?.tenderId);
// Sample data based on your JSON
const route = useRoute<any>();
const tenderDataId = route.params?.tender;
const { data, refetch } = useProceedToBid(tenderDataId?.tenderId);
const { data: tenderResponse , refetch:tenderRefetch}: any = useFetchTenderById(tenderDataId?.tenderId);
const tenderData = tenderResponse?.data;
const [refreshing, setRefreshing] = React.useState(false);
console.log("proceed to bid tender detail : ", tenderDataId)
console.log("proceed to data detail : ", data)
console.log("tender data for updated : ", tenderData)
const navigation = useNavigation<any>()
// Format date from array
const handleStartBidding = () => {
refetch();
if (data) {
console.log(" ppp",tenderData ,"ll",data)
navigation.navigate('TenderBidding', { tenderData: tenderData, bidData: data.data });
}
};
// Status indicator component
const StatusIndicator = ({ status, label }: { status: any, label: string }) => (
const StatusIndicator = ({ status, label }: { status: boolean; label: string }) => (
<View style={styles.statusContainer}>
<View style={[styles.statusDot, { backgroundColor: status ? colors.success : colors.error }]} />
<Text style={[styles.statusText, { color: status ? colors.success : colors.error, fontFamily: FontsFamily.poppinsSemiBold }]}>
@@ -31,16 +40,14 @@ const ProceedToBidDetail = () => {
);
// Envelope log card component
const EnvelopeLogCard = ({ log, title }: { log: any, title: string }) => {
return (
<View style={styles.envelopeCard}>
<View style={styles.cardHeader}>
<Text style={[styles.cardTitle, { fontFamily: FontsFamily.poppinsSemiBold }]}>{title}</Text>
<View style={[styles.envelopeBadge, { backgroundColor: colors.primary }]}>
<Text style={[styles.envelopeBadgeText, { fontFamily: FontsFamily.poppinsSemiBold }]}>{log?.envelope}</Text>
</View>
const EnvelopeLogCard = ({ log, title }: { log: any; title: string }) => (
<View style={styles.envelopeCard}>
<View style={styles.cardHeader}>
<Text style={styles.cardTitle}>{title}</Text>
<View style={[styles.envelopeBadge, { backgroundColor: colors.primary }]}>
<Text style={styles.envelopeBadgeText}>{log?.envelope}</Text>
</View>
</View>
<View style={styles.logDetailRow}>
<Text style={[styles.label, { fontFamily: FontsFamily.poppinsMedium }]}>Activity:</Text>
@@ -78,7 +85,7 @@ const ProceedToBidDetail = () => {
}
// Information row component
const InfoRow = ({ label, value, isHighlighted = false }: { label: string, value: string, isHighlighted?: boolean }) => (
const InfoRow = ({ label, value, isHighlighted = false }: { label: string; value: string; isHighlighted?: boolean }) => (
<View style={styles.infoRow}>
<Text style={[styles.infoLabel, { fontFamily: FontsFamily.poppinsMedium }]}>{label}:</Text>
<Text style={[styles.infoValue, isHighlighted && styles.highlightedValue, { fontFamily: FontsFamily.poppinsSemiBold }]}>{value}</Text>
@@ -86,7 +93,7 @@ const ProceedToBidDetail = () => {
);
// Feature chip component
const FeatureChip = ({ label, enabled }: { label: string, enabled: boolean }) => (
const FeatureChip = ({ label, enabled }: { label: string; enabled: boolean }) => (
<View style={[styles.chip, { backgroundColor: enabled ? colors.successLight : colors.lightGray }]}>
<Text style={[styles.chipText, { color: enabled ? colors.success : colors.darkGray, fontFamily: FontsFamily.poppinsSemiBold }]}>
{label} {enabled ? '✓' : '✗'}
@@ -94,12 +101,33 @@ const ProceedToBidDetail = () => {
</View>
);
const onRefresh = async () => {
try {
setRefreshing(true);
await refetch();
} finally {
setRefreshing(false);
}
};
useEffect(()=>{
tenderRefetch()
},[tenderDataId?.tenderId])
return (
<View style={{ flex: 1, backgroundColor: colors.white }}>
<InsideHeader title="Tender Detail" showArrow />
<ScrollView style={styles.container} showsVerticalScrollIndicator={false} contentContainerStyle={{ paddingBottom: 100 }}>
{/* Tender Header */}
<ScrollView style={styles.container} showsVerticalScrollIndicator={false}
refreshControl={
<RefreshControl
refreshing={refreshing}
onRefresh={onRefresh}
colors={[colors.primary]} // Android
tintColor={colors.primary} // iOS
/>
}>
{/* Tender Header Section */}
<View style={styles.headerCard}>
<View style={styles.tenderHeader}>
<View>