This commit is contained in:
sazzadulalambd
2026-05-19 20:45:10 +06:00
parent 233327e488
commit 9442e64a86
5 changed files with 196 additions and 1574 deletions

View File

@@ -56,6 +56,14 @@ export default function InvestorProfilePage() {
const [showUploadDocModal, setShowUploadDocModal] = useState(false);
const [uploadDocForm, setUploadDocForm] = useState({ docType: '', docNumber: '', docFile: null as File | null });
const [showApprovalModal, setShowApprovalModal] = useState(false);
const [approvalModalConfig, setApprovalModalConfig] = useState({ actionType: '', fieldName: '' });
const triggerApprovalRequest = (actionType: string, fieldName: string) => {
setApprovalModalConfig({ actionType, fieldName });
setShowApprovalModal(true);
};
const [showAddBankModal, setShowAddBankModal] = useState(false);
const [showEditBankModal, setShowEditBankModal] = useState(false);
const [showDeleteBankModal, setShowDeleteBankModal] = useState(false);
@@ -95,27 +103,27 @@ export default function InvestorProfilePage() {
};
const handleSaveBank = () => {
toast.success('Bank account saved successfully!');
setShowAddBankModal(false);
setShowEditBankModal(false);
setNewBankForm({ bankName: '', accountName: '', accountNumber: '', branch: '', routing: '', isPrimary: false });
triggerApprovalRequest('save/edit', 'Bank Account');
};
const handleDeleteBank = () => {
toast.success('Bank account deleted!');
setShowDeleteBankModal(false);
triggerApprovalRequest('delete', 'Bank Account');
};
const handleSaveMobile = () => {
toast.success('Mobile banking saved successfully!');
setShowAddMobileModal(false);
setShowEditMobileModal(false);
setNewMobileForm({ provider: '', number: '' });
triggerApprovalRequest('save/edit', 'Mobile Banking Account');
};
const handleDeleteMobile = () => {
toast.success('Mobile banking deleted!');
setShowDeleteMobileModal(false);
triggerApprovalRequest('delete', 'Mobile Banking Account');
};
const handleLogout = () => {
@@ -1117,7 +1125,7 @@ export default function InvestorProfilePage() {
</div>
<div className="p-5 border-t border-slate-100 flex justify-end gap-3">
<button onClick={() => setShowTaxModal(false)} className="px-4 py-2 border border-slate-200 text-slate-600 rounded-lg text-sm hover:bg-slate-50">Cancel</button>
<button onClick={() => { toast.success('Tax information updated'); setShowTaxModal(false); }} className="px-4 py-2 bg-investor text-white rounded-lg text-sm font-medium hover:bg-investor-dark">Save</button>
<button onClick={() => { setShowTaxModal(false); triggerApprovalRequest('save/edit', 'Tax Information'); }} className="px-4 py-2 bg-investor text-white rounded-lg text-sm font-medium hover:bg-investor-dark">Save</button>
</div>
</div>
</div>
@@ -1208,6 +1216,35 @@ export default function InvestorProfilePage() {
</div>
</div>
)}
{showApprovalModal && (
<div className="fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4">
<div className="bg-white rounded-2xl shadow-2xl w-full max-w-md overflow-hidden border border-slate-100 animate-in fade-in zoom-in duration-200">
<div className="p-6 text-center space-y-4">
<div className="w-16 h-16 bg-amber-50 rounded-full flex items-center justify-center mx-auto text-amber-500 border border-amber-200">
<ShieldCheck className="w-8 h-8" />
</div>
<div className="space-y-2">
<h3 className="text-xl font-bold text-slate-800">Verification Request Submitted</h3>
<p className="text-sm text-slate-500 leading-relaxed">
Your request to <strong className="text-slate-700">{approvalModalConfig.actionType}</strong> your <strong className="text-slate-700">{approvalModalConfig.fieldName}</strong> has been successfully sent to JAIBEN administrators.
</p>
<p className="text-xs text-slate-400 bg-slate-50 p-2.5 rounded-lg border border-slate-100 italic">
For security reasons, all updates to bank credentials, mobile wallets, or tax IDs require manual review. You will be notified once our team verifies the changes.
</p>
</div>
</div>
<div className="p-4 bg-slate-50 border-t border-slate-100 flex justify-center">
<button
onClick={() => setShowApprovalModal(false)}
className="w-full py-2.5 bg-investor hover:bg-investor-dark text-white rounded-xl text-sm font-semibold transition-all shadow-md shadow-investor/10"
>
Understood & Continue
</button>
</div>
</div>
</div>
)}
</div>
</div>
);