This commit is contained in:
Abin Toppo
2026-01-15 17:21:34 +05:30
parent 211ee99ae9
commit 2f42c03d58
8 changed files with 1126 additions and 18 deletions
+19 -12
View File
@@ -4,9 +4,10 @@ import Modal from 'react-native-modal';
import Animated, { useSharedValue, useAnimatedStyle, withTiming, withDelay } from 'react-native-reanimated';
import { Home, Gavel, FileText, User, LogOut, ChevronRight } from 'lucide-react-native';
import { CommonActions, useNavigation } from '@react-navigation/native';
import { useDispatch } from 'react-redux';
import { useDispatch, useSelector } from 'react-redux';
import { removeToken } from '../../Redux/Slices/Token';
import NavigationString from '../../Constant/NavigationString';
import colors from '../../Constant/Color';
const { width, height } = Dimensions.get('window');
const DRAWER_WIDTH = width * 0.78;
@@ -16,8 +17,9 @@ interface Props { visible: boolean; onClose: () => void; }
const SideDrawer: React.FC<Props> = ({ visible, onClose }) => {
const navigation: any = useNavigation();
const dispatch = useDispatch();
const userData = useSelector((state: any) => state.token?.token);
const user = { name: 'Rohit Kumar', role: 'Procurement Manager', avatar: 'https://i.pravatar.cc/150?img=12', };
const user = { name: userData?.fullName, role: userData?.role, };
const translateX = useSharedValue(-DRAWER_WIDTH);
useEffect(() => {
@@ -31,6 +33,11 @@ const SideDrawer: React.FC<Props> = ({ visible, onClose }) => {
}));
const menuItems = [
{
label: 'Profile',
icon: User,
onPress: () => navigation.navigate(NavigationString.Profile),
},
{
label: 'Home',
icon: Home,
@@ -45,12 +52,8 @@ const SideDrawer: React.FC<Props> = ({ visible, onClose }) => {
label: 'Tenders',
icon: FileText,
onPress: () => navigation.navigate(NavigationString.Tender),
}
// {
// label: 'Profile',
// icon: User,
// onPress: () => { },
// },
},
];
return (
@@ -75,7 +78,9 @@ const SideDrawer: React.FC<Props> = ({ visible, onClose }) => {
<X size={20} color="#111827" />
</TouchableOpacity> */}
<Image source={{ uri: user.avatar }} style={styles.avatar} />
<View style={styles.avatar}>
<User size={40} color={colors.black} strokeWidth={2} />
</View>
<Text style={styles.userName}>{user.name}</Text>
<Text style={styles.userRole}>{user.role}</Text>
@@ -180,9 +185,11 @@ const styles = StyleSheet.create({
},
avatar: {
width: 72,
height: 72,
borderRadius: 36,
justifyContent:'center',
alignItems:'center',
backgroundColor:colors.primary,
padding:25,
borderRadius:60,
marginBottom: 10,
},
+1
View File
@@ -20,5 +20,6 @@ const NavigationString = {
Partnership:'Partnership',
LiveTenderDetail:'LiveTenderDetail',
AuctionDetail: 'AuctionDetail',
Profile:'Profile'
}
export default NavigationString
+3 -2
View File
@@ -25,7 +25,7 @@ const TabButton = ({ route, isFocused, onPress }: any) => {
Home: { outline: "Home", filled: "Home" },
Auction: { outline: "Gavel", filled: "Gavel" },
Tender: { outline: "FileText", filled: "FileText" },
EditableExcel: { outline: "FileText", filled: "FileText" },
Profile: { outline: "User", filled: "User" },
};
const IconName = LucideIcons[isFocused ? icons[route.name].filled : icons[route.name].outline];
const scaleAnim = useRef(new Animated.Value(1)).current;
@@ -148,7 +148,8 @@ export default function BottomTab() {
<Tab.Screen name="Home" component={Screens.Home} />
<Tab.Screen name={NavigationString.Auction} component={Screens.Auction} />
<Tab.Screen name={NavigationString.Tender} component={Screens.Tender} />
<Tab.Screen name={'EditableExcel'} component={EditableExcel} />
{/* <Tab.Screen name={'EditableExcel'} component={EditableExcel} /> */}
<Tab.Screen name={NavigationString.Profile} component={Screens.ProfileTab} />
</Tab.Navigator>
</View>
File diff suppressed because it is too large Load Diff
+2
View File
@@ -7,6 +7,7 @@ import StartReverseBidding from "./Bidding/StartReverseBidding";
import Home from "./Home/Home";
import Login from "./Login/Login";
import Onboarding from "./Onboarding/Onboarding";
import ProfileTab from "./Profile/ProfileTab";
import Partnership from "./Ragistration/PartnerShip";
import Registration from "./Ragistration/Ragistration";
import Signup from "./SignUp/SignUp";
@@ -39,6 +40,7 @@ const Screens = {
Registration,
Partnership,
LiveTenderDetail,
ProfileTab
}
+4 -1
View File
@@ -82,6 +82,8 @@ const SUBMIT_ENVELOPE_FILE_A = `${BASE_URL}tenderBidding/addDocumentsEnvelopeA`
const SUBMIT_ENVELOPE_FILE_B = `https://procurelinc.in/EProcurementSB/tenderBidding/addDocumentsEnvelopeB`
const GET_ENVELOPE_C = `${BASE_URL}eTendering/getEnvelopeCTemplate/tenderId?tenderId=`
const SUBMIT_ENVELOPE_C_UPLOAD = `${BASE_URL}tenderBidding/getSaveEnvelopeCData`
const GET_CONTRACTOR_PROFILE =`${BASE_URL}contractor/getcontractorfulldetails
`
@@ -159,6 +161,7 @@ export {
SUBMIT_ENVELOPE_FILE_B,
GET_ENVELOPE_C,
SUBMIT_ENVELOPE_C_UPLOAD,
GET_TENDER_BY_ID
GET_TENDER_BY_ID,
GET_CONTRACTOR_PROFILE
};
+14 -1
View File
@@ -1,5 +1,5 @@
import { useInfiniteQuery, useMutation, useQuery } from '@tanstack/react-query';
import { contractorStageThreeSubmit, contractorStageTwoSubmit, fetchAuctionItem, fetchCityDropdown, fetchDashboard, fetchEmdCheck, fetchLiveAuction, fetchLiveTender, fetchMasterData, fetchPurchaseAuction, fetchPurchaseAuctionList, fetchPurchaseTender, fetchTenderById, getAuction, getDesignation, getRagistrationState, offlineAuctionPurchase, offlineTenderPurchase, partnerShipSubmit, proceedToBid, registerContractor, sendAadhaarOtp, submitEnvelopeA, submitEnvelopeB, uploadEnvelopeFile, userAuctionLogin, userLogin, verifyAadhaarOtp, verifyGstNumber, verifyPanHandler, viewAuctionDocumentDownload, viewAuctionDocuments, viewAuctionItemDocuments, fetchPurchaseAuctionPage, tenderDetails, fetchLiveTenderById } from './apis';
import { contractorStageThreeSubmit, contractorStageTwoSubmit, fetchAuctionItem, fetchCityDropdown, fetchDashboard, fetchEmdCheck, fetchLiveAuction, fetchLiveTender, fetchMasterData, fetchPurchaseAuction, fetchPurchaseAuctionList, fetchPurchaseTender, fetchTenderById, getAuction, getDesignation, getRagistrationState, offlineAuctionPurchase, offlineTenderPurchase, partnerShipSubmit, proceedToBid, registerContractor, sendAadhaarOtp, submitEnvelopeA, submitEnvelopeB, uploadEnvelopeFile, userAuctionLogin, userLogin, verifyAadhaarOtp, verifyGstNumber, verifyPanHandler, viewAuctionDocumentDownload, viewAuctionDocuments, viewAuctionItemDocuments, fetchPurchaseAuctionPage, tenderDetails, fetchLiveTenderById, fetchContractorProfile, updateUserProfile } from './apis';
// User
@@ -58,6 +58,13 @@ export const useFetchLiveTender = () => {
queryFn: () => fetchLiveTender()
});
};
export const useContractorProfile = () => {
return useQuery({
queryKey: ['Profile',],
queryFn: () => fetchContractorProfile()
});
};
export const useFetchPurchaseAuction = () => {
return useQuery({
@@ -190,6 +197,12 @@ export const useRagistrationState = () => {
});
};
export const useUpdateUserProfile = () => {
return useMutation({
mutationFn: (payload:any) => updateUserProfile(payload),
});
};
export const usefetchMasterData = () => {
return useQuery({
+21 -2
View File
@@ -1,5 +1,5 @@
import axios from "axios";
import { AUCTION_DOCUMENT_DOWNLOAD, DASHBOARD_COUNT, EMD_CHECK, FORARD_AUCTION_ITEM, GET_AUCTION_DETAILS, GET_MY_AUCTION, GET_MY_TENDER, GET_TENDER_DETAILS, LIVE_AUCTION, LIVE_TENDER, LOG_IN_URL, PROCEED_PURCHASE_AUCTION, PROCEED_TO_BID, PURCHASE_TENDER_OFFLINE, TENDER_LOGIN, PURCHASE_AUCTION_LIST, PURCHASE_OFFLINE_AUCTION, REVERSE_AUCTION_ITEM, VIEW_AUCTION_DOCUMENTS, VIEW_AUCTION_ITEM_DETAIL, STAGETHREE, REJ_STAGE_TWO, GETCONTRACTORBYSTATE, GET_MASTER_DATA, ALL_DESIGNATION, GET_REGISTRATION_STATE, PARTNER_API_ENDPOINT, SAVE_CONTRACTOR_STAGE1, VERIFY_GST, VERIFY_ADHAR, SEND_ADHAROTP, SUBMIT_ENVELOPE_FILE_B, SUBMIT_ENVELOPE_FILE_A, SUBMIT_ENVELOPE_A, SUBMIT_ENVELOPE_B, VERIFY_ORGPAN, PURCHASE_AUCTION_PAGE, GET_TENDER_BY_ID } from "./ApiUrls";
import { AUCTION_DOCUMENT_DOWNLOAD, DASHBOARD_COUNT, EMD_CHECK, FORARD_AUCTION_ITEM, GET_AUCTION_DETAILS, GET_MY_AUCTION, GET_MY_TENDER, GET_TENDER_DETAILS, LIVE_AUCTION, LIVE_TENDER, LOG_IN_URL, PROCEED_PURCHASE_AUCTION, PROCEED_TO_BID, PURCHASE_TENDER_OFFLINE, TENDER_LOGIN, PURCHASE_AUCTION_LIST, PURCHASE_OFFLINE_AUCTION, REVERSE_AUCTION_ITEM, VIEW_AUCTION_DOCUMENTS, VIEW_AUCTION_ITEM_DETAIL, STAGETHREE, REJ_STAGE_TWO, GETCONTRACTORBYSTATE, GET_MASTER_DATA, ALL_DESIGNATION, GET_REGISTRATION_STATE, PARTNER_API_ENDPOINT, SAVE_CONTRACTOR_STAGE1, VERIFY_GST, VERIFY_ADHAR, SEND_ADHAROTP, SUBMIT_ENVELOPE_FILE_B, SUBMIT_ENVELOPE_FILE_A, SUBMIT_ENVELOPE_A, SUBMIT_ENVELOPE_B, VERIFY_ORGPAN, PURCHASE_AUCTION_PAGE, GET_TENDER_BY_ID, GET_CONTRACTOR_PROFILE, CONTRACTOR_PROFILE_UPDATE } from "./ApiUrls";
import { apiCall } from "../../Axios/Axios";
// User
@@ -129,6 +129,10 @@ export const fetchLiveTender = async (): Promise<any> => {
const data = await apiCall<any>('get', `${LIVE_TENDER}`);
return data
}
export const fetchContractorProfile = async (): Promise<any> => {
const data = await apiCall<any>('get', `${GET_CONTRACTOR_PROFILE}`);
return data.data
}
export const fetchTenderById = async (tenderId: string): Promise<any> => {
const data = await apiCall<any>(
'get',
@@ -159,7 +163,22 @@ export const verifyPanHandler = (
);
};
export const updateUserProfile = (
payload: {
firstName: string,
middleName: string,
lastName: string,
mobileNo: string,
emailId: string,
fullname: string
}
): Promise<any> => {
return apiCall<any>(
'put',
CONTRACTOR_PROFILE_UPDATE,
payload,
);
};
export const fetchPurchaseAuctionList = async (payload: any): Promise<any> => {
const data = await apiCall<any>('post', `${PURCHASE_AUCTION_LIST}`, payload);
return data