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 Animated, { useSharedValue, useAnimatedStyle, withTiming, withDelay } from 'react-native-reanimated';
import { Home, Gavel, FileText, User, LogOut, ChevronRight } from 'lucide-react-native'; import { Home, Gavel, FileText, User, LogOut, ChevronRight } from 'lucide-react-native';
import { CommonActions, useNavigation } from '@react-navigation/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 { removeToken } from '../../Redux/Slices/Token';
import NavigationString from '../../Constant/NavigationString'; import NavigationString from '../../Constant/NavigationString';
import colors from '../../Constant/Color';
const { width, height } = Dimensions.get('window'); const { width, height } = Dimensions.get('window');
const DRAWER_WIDTH = width * 0.78; const DRAWER_WIDTH = width * 0.78;
@@ -16,8 +17,9 @@ interface Props { visible: boolean; onClose: () => void; }
const SideDrawer: React.FC<Props> = ({ visible, onClose }) => { const SideDrawer: React.FC<Props> = ({ visible, onClose }) => {
const navigation: any = useNavigation(); const navigation: any = useNavigation();
const dispatch = useDispatch(); 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); const translateX = useSharedValue(-DRAWER_WIDTH);
useEffect(() => { useEffect(() => {
@@ -31,6 +33,11 @@ const SideDrawer: React.FC<Props> = ({ visible, onClose }) => {
})); }));
const menuItems = [ const menuItems = [
{
label: 'Profile',
icon: User,
onPress: () => navigation.navigate(NavigationString.Profile),
},
{ {
label: 'Home', label: 'Home',
icon: Home, icon: Home,
@@ -45,12 +52,8 @@ const SideDrawer: React.FC<Props> = ({ visible, onClose }) => {
label: 'Tenders', label: 'Tenders',
icon: FileText, icon: FileText,
onPress: () => navigation.navigate(NavigationString.Tender), onPress: () => navigation.navigate(NavigationString.Tender),
} },
// {
// label: 'Profile',
// icon: User,
// onPress: () => { },
// },
]; ];
return ( return (
@@ -75,7 +78,9 @@ const SideDrawer: React.FC<Props> = ({ visible, onClose }) => {
<X size={20} color="#111827" /> <X size={20} color="#111827" />
</TouchableOpacity> */} </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.userName}>{user.name}</Text>
<Text style={styles.userRole}>{user.role}</Text> <Text style={styles.userRole}>{user.role}</Text>
@@ -180,9 +185,11 @@ const styles = StyleSheet.create({
}, },
avatar: { avatar: {
width: 72, justifyContent:'center',
height: 72, alignItems:'center',
borderRadius: 36, backgroundColor:colors.primary,
padding:25,
borderRadius:60,
marginBottom: 10, marginBottom: 10,
}, },
+1
View File
@@ -20,5 +20,6 @@ const NavigationString = {
Partnership:'Partnership', Partnership:'Partnership',
LiveTenderDetail:'LiveTenderDetail', LiveTenderDetail:'LiveTenderDetail',
AuctionDetail: 'AuctionDetail', AuctionDetail: 'AuctionDetail',
Profile:'Profile'
} }
export default NavigationString export default NavigationString
+3 -2
View File
@@ -25,7 +25,7 @@ const TabButton = ({ route, isFocused, onPress }: any) => {
Home: { outline: "Home", filled: "Home" }, Home: { outline: "Home", filled: "Home" },
Auction: { outline: "Gavel", filled: "Gavel" }, Auction: { outline: "Gavel", filled: "Gavel" },
Tender: { outline: "FileText", filled: "FileText" }, 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 IconName = LucideIcons[isFocused ? icons[route.name].filled : icons[route.name].outline];
const scaleAnim = useRef(new Animated.Value(1)).current; 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="Home" component={Screens.Home} />
<Tab.Screen name={NavigationString.Auction} component={Screens.Auction} /> <Tab.Screen name={NavigationString.Auction} component={Screens.Auction} />
<Tab.Screen name={NavigationString.Tender} component={Screens.Tender} /> <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> </Tab.Navigator>
</View> </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 Home from "./Home/Home";
import Login from "./Login/Login"; import Login from "./Login/Login";
import Onboarding from "./Onboarding/Onboarding"; import Onboarding from "./Onboarding/Onboarding";
import ProfileTab from "./Profile/ProfileTab";
import Partnership from "./Ragistration/PartnerShip"; import Partnership from "./Ragistration/PartnerShip";
import Registration from "./Ragistration/Ragistration"; import Registration from "./Ragistration/Ragistration";
import Signup from "./SignUp/SignUp"; import Signup from "./SignUp/SignUp";
@@ -39,6 +40,7 @@ const Screens = {
Registration, Registration,
Partnership, Partnership,
LiveTenderDetail, 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 SUBMIT_ENVELOPE_FILE_B = `https://procurelinc.in/EProcurementSB/tenderBidding/addDocumentsEnvelopeB`
const GET_ENVELOPE_C = `${BASE_URL}eTendering/getEnvelopeCTemplate/tenderId?tenderId=` const GET_ENVELOPE_C = `${BASE_URL}eTendering/getEnvelopeCTemplate/tenderId?tenderId=`
const SUBMIT_ENVELOPE_C_UPLOAD = `${BASE_URL}tenderBidding/getSaveEnvelopeCData` 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, SUBMIT_ENVELOPE_FILE_B,
GET_ENVELOPE_C, GET_ENVELOPE_C,
SUBMIT_ENVELOPE_C_UPLOAD, 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 { 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 // User
@@ -58,6 +58,13 @@ export const useFetchLiveTender = () => {
queryFn: () => fetchLiveTender() queryFn: () => fetchLiveTender()
}); });
}; };
export const useContractorProfile = () => {
return useQuery({
queryKey: ['Profile',],
queryFn: () => fetchContractorProfile()
});
};
export const useFetchPurchaseAuction = () => { export const useFetchPurchaseAuction = () => {
return useQuery({ return useQuery({
@@ -190,6 +197,12 @@ export const useRagistrationState = () => {
}); });
}; };
export const useUpdateUserProfile = () => {
return useMutation({
mutationFn: (payload:any) => updateUserProfile(payload),
});
};
export const usefetchMasterData = () => { export const usefetchMasterData = () => {
return useQuery({ return useQuery({
+21 -2
View File
@@ -1,5 +1,5 @@
import axios from "axios"; 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"; import { apiCall } from "../../Axios/Axios";
// User // User
@@ -129,6 +129,10 @@ export const fetchLiveTender = async (): Promise<any> => {
const data = await apiCall<any>('get', `${LIVE_TENDER}`); const data = await apiCall<any>('get', `${LIVE_TENDER}`);
return data 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> => { export const fetchTenderById = async (tenderId: string): Promise<any> => {
const data = await apiCall<any>( const data = await apiCall<any>(
'get', '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> => { export const fetchPurchaseAuctionList = async (payload: any): Promise<any> => {
const data = await apiCall<any>('post', `${PURCHASE_AUCTION_LIST}`, payload); const data = await apiCall<any>('post', `${PURCHASE_AUCTION_LIST}`, payload);
return data return data