feat: add document preview links for Aadhar and PAN in settings tab
All checks were successful
Beta CI/CD Pipeline / build-and-test (push) Successful in 1m2s
Beta CI/CD Pipeline / deploy-beta (push) Successful in 10s

This commit is contained in:
vickytechkey 2026-08-28 16:06:32 +05:30
parent f85bc5b9d4
commit ca06e999e2
2 changed files with 29 additions and 3 deletions

View file

@ -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() {
<span className="file-name">{aadharFile || aadharS3Key || 'No file uploaded'}</span>
</label>
</div>
{/* Add Preview Link Below */}
{aadharUrl && (
<p className="help mt-2">
<a href={aadharUrl} target="_blank" rel="noopener noreferrer">
<span className="icon is-small"><i className="material-symbols-outlined" style={{ fontSize: '14px' }}>visibility</i></span>
Preview Aadhar
</a>
</p>
)}
</div>
</div>
</div>
@ -370,6 +379,15 @@ export default function SettingsTab() {
<span className="file-name">{panFile || panS3Key || 'No file uploaded'}</span>
</label>
</div>
{/* Add Preview Link Below */}
{panUrl && (
<p className="help mt-2">
<a href={panUrl} target="_blank" rel="noopener noreferrer">
<span className="icon is-small"><i className="material-symbols-outlined" style={{ fontSize: '14px' }}>visibility</i></span>
Preview PAN
</a>
</p>
)}
</div>
</div>
</div>

View file

@ -71,7 +71,9 @@ export const SellerProvider: React.FC<{children: React.ReactNode}> = ({ children
const [aadharFile, setAadharFile] = useState<string | null>(null)
const [panFile, setPanFile] = useState<string | null>(null)
const [aadharS3Key, setAadharS3Key] = useState<string | null>(null)
const [aadharUrl, setAadharUrl] = useState<string | null>(null) // New
const [panS3Key, setPanS3Key] = useState<string | null>(null)
const [panUrl, setPanUrl] = useState<string | null>(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 (