diff --git a/src/components/dashboard/tabs/SettingsTab.tsx b/src/components/dashboard/tabs/SettingsTab.tsx index d452b49..2167d31 100644 --- a/src/components/dashboard/tabs/SettingsTab.tsx +++ b/src/components/dashboard/tabs/SettingsTab.tsx @@ -15,8 +15,8 @@ export default function SettingsTab() { emailVerified, phoneVerified, setEmailVerified, setPhoneVerified, // Business Details gstin, setGstin, isGstinVerified, handleVerifyGstin, - aadharFile, aadharS3Key, - panFile, panS3Key, + aadharFile, aadharS3Key, aadharUrl, + panFile, panS3Key, panUrl, // Location address, setAddress } = useSeller(); @@ -351,6 +351,15 @@ export default function SettingsTab() { {aadharFile || aadharS3Key || 'No file uploaded'} + {/* Add Preview Link Below */} + {aadharUrl && ( +

+ + visibility + Preview Aadhar + +

+ )} @@ -370,6 +379,15 @@ export default function SettingsTab() { {panFile || panS3Key || 'No file uploaded'} + {/* Add Preview Link Below */} + {panUrl && ( +

+ + visibility + Preview PAN + +

+ )} diff --git a/src/context/SellerContext.tsx b/src/context/SellerContext.tsx index 751f98b..ddaa895 100644 --- a/src/context/SellerContext.tsx +++ b/src/context/SellerContext.tsx @@ -71,7 +71,9 @@ export const SellerProvider: React.FC<{children: React.ReactNode}> = ({ children const [aadharFile, setAadharFile] = useState(null) const [panFile, setPanFile] = useState(null) const [aadharS3Key, setAadharS3Key] = useState(null) + const [aadharUrl, setAadharUrl] = useState(null) // New const [panS3Key, setPanS3Key] = useState(null) + const [panUrl, setPanUrl] = useState(null) // New // New onboarding customization states const [businessType, setBusinessType] = useState<'registered_company' | 'self_help_group' | 'individual_maker'>('registered_company') @@ -194,6 +196,8 @@ export const SellerProvider: React.FC<{children: React.ReactNode}> = ({ children setPanFile(profile.pan_file || null); setAadharS3Key(profile.aadhar_s3_key || null); setPanS3Key(profile.pan_s3_key || null); + setAadharUrl(profile.aadhar_url || null); // New + setPanUrl(profile.pan_url || null); // New setBusinessType(profile.business_type || 'registered_company'); setStoreSlug(profile.store_slug || ''); @@ -410,7 +414,9 @@ export const SellerProvider: React.FC<{children: React.ReactNode}> = ({ children setAadharFile(null) setPanFile(null) setAadharS3Key(null) + setAadharUrl(null) setPanS3Key(null) + setPanUrl(null) setBusinessType('registered_company') setStoreSlug('') @@ -538,6 +544,8 @@ export const SellerProvider: React.FC<{children: React.ReactNode}> = ({ children setPanFile(profile.pan_file || null); setAadharS3Key(profile.aadhar_s3_key || null); setPanS3Key(profile.pan_s3_key || null); + setAadharUrl(profile.aadhar_url || null); + setPanUrl(profile.pan_url || null); setBusinessType(profile.business_type || 'registered_company'); setStoreSlug(profile.store_slug || ''); setSupportEmail(profile.support_email || ''); @@ -816,7 +824,7 @@ export const SellerProvider: React.FC<{children: React.ReactNode}> = ({ children const contextValue = { - setBusinessBio, email, resetPassword, setLogoS3Key, setStoreName, setShowLoginPass, storeName, otpLoginSent, setOtpLoginSent, aadharS3Key, logoS3Key, customDates, setProductFormDetails, handleBulkUploadSubmit, setMapCoordinates, setAadharFile, gstin, mapCoordinates, setIsGstinVerified, enteredPhoneOtp, address, setEmailVerified, dashTab, selectedOrderDetail, setShowSignupConfirmPass, handleRegisterSubmit, setBulkCsvFile, confirmPassword, navigateTo, setResetPassword, orderNotes, setOrders, handleRejectOrder, barcodeProductSku, setEnteredEmailOtp, setIsEditingProduct, setBulkLog, isMobileMenuOpen, resetOtp, productWizardStep, setCustomDates, setConfirmPassword, isGstinVerified, bulkCsvFile, setAddress, storeLogo, handleProfileSubmit, setPhoneOtpSent, setOrderNotes, handleDeleteProduct, setWallet, policyAccepted, emailOtpSent, setResetOtpSent, setGstin, phoneOtpSent, showLoginPass, showSignupConfirmPass, setPhoneVerified, aadharFile, setDateFilter, activeTab, computeRealtimeMetrics, setIsParsingBulk, handleLogout, panS3Key, setCurrentPage, selectedCategories, setEmailOtpSent, showSignupPass, resetEmail, handleLogoChange, dateFilter, setShowSignupPass, businessBio, setWithdrawAmount, phoneVerified, currentPage, setResetOtp, enteredEmailOtp, setEnteredPhoneOtp, setPanFile, setIsSidebarOpen, setSelectedOrderDetail, handleAcceptOrder, saveProfileBackend, supportPhone, handleEditClick, setStoreLogo, setEmail, password, setOtpLoginPhone, bulkLog, businessType, setPanS3Key, setProducts, setSupportEmail, setOtpLoginCode, withdrawAmount, handleSaveProduct, setStoreSlug, setBarcodeProductSku, setProductForm, setBulkZipFile, productFormDetails, setIsProfileComplete, otpLoginPhone, orders, setActiveTab, bulkZipFile, isSidebarOpen, setBarcodeGenerated, setBusinessType, handleReturnAction, setSupportPhone, barcodeGenerated, products, productForm, setProductWizardStep, resetOtpSent, emailVerified, panFile, isParsingBulk, setDashTab, setReturns, setPassword, handleWithdrawRequest, uploadDocument, setPolicyAccepted, isEditingProduct, setIsMobileMenuOpen, isProfileComplete, setSelectedCategories, storeSlug, phone, setPhone, setAadharS3Key, handleVerifyGstin, returns, handleLoginSubmit, setResetEmail, wallet, otpLoginCode, supportEmail + setBusinessBio, email, resetPassword, setLogoS3Key, setStoreName, setShowLoginPass, storeName, otpLoginSent, setOtpLoginSent, aadharS3Key, logoS3Key, customDates, setProductFormDetails, handleBulkUploadSubmit, setMapCoordinates, setAadharFile, gstin, mapCoordinates, setIsGstinVerified, enteredPhoneOtp, address, setEmailVerified, dashTab, selectedOrderDetail, setShowSignupConfirmPass, handleRegisterSubmit, setBulkCsvFile, confirmPassword, navigateTo, setResetPassword, orderNotes, setOrders, handleRejectOrder, barcodeProductSku, setEnteredEmailOtp, setIsEditingProduct, setBulkLog, isMobileMenuOpen, resetOtp, productWizardStep, setCustomDates, setConfirmPassword, isGstinVerified, bulkCsvFile, setAddress, storeLogo, handleProfileSubmit, setPhoneOtpSent, setOrderNotes, handleDeleteProduct, setWallet, policyAccepted, emailOtpSent, setResetOtpSent, setGstin, phoneOtpSent, showLoginPass, showSignupConfirmPass, setPhoneVerified, aadharFile, setDateFilter, activeTab, computeRealtimeMetrics, setIsParsingBulk, handleLogout, panS3Key, setCurrentPage, selectedCategories, setEmailOtpSent, showSignupPass, resetEmail, handleLogoChange, dateFilter, setShowSignupPass, businessBio, setWithdrawAmount, phoneVerified, currentPage, setResetOtp, enteredEmailOtp, setEnteredPhoneOtp, setPanFile, setIsSidebarOpen, setSelectedOrderDetail, handleAcceptOrder, saveProfileBackend, supportPhone, handleEditClick, setStoreLogo, setEmail, password, setOtpLoginPhone, bulkLog, businessType, setPanS3Key, setProducts, setSupportEmail, setOtpLoginCode, withdrawAmount, handleSaveProduct, setStoreSlug, setBarcodeProductSku, setProductForm, setBulkZipFile, productFormDetails, setIsProfileComplete, otpLoginPhone, orders, setActiveTab, bulkZipFile, isSidebarOpen, setBarcodeGenerated, setBusinessType, handleReturnAction, setSupportPhone, barcodeGenerated, products, productForm, setProductWizardStep, resetOtpSent, emailVerified, panFile, isParsingBulk, setDashTab, setReturns, setPassword, handleWithdrawRequest, uploadDocument, setPolicyAccepted, isEditingProduct, setIsMobileMenuOpen, isProfileComplete, setSelectedCategories, storeSlug, phone, setPhone, setAadharS3Key, handleVerifyGstin, returns, handleLoginSubmit, setResetEmail, wallet, otpLoginCode, supportEmail, aadharUrl, setAadharUrl, panUrl, setPanUrl }; return (