feat : remove log in IB
This commit is contained in:
@@ -30,6 +30,7 @@ export default function Home() {
|
||||
const selectedLNData = loanAccounts.find(acc => acc.stAccountNo === selectedLN);
|
||||
const [showBalance, setShowBalance] = useState(false);
|
||||
const PassExpiryRemains = (dayjs(localStorage.getItem("pswExpiryDate"))).diff(dayjs(), "day")
|
||||
const [loadingAccountNo, setLoadingAccountNo] = useState<string | null>(null);
|
||||
|
||||
// If back and forward button is clicked
|
||||
useEffect(() => {
|
||||
@@ -93,7 +94,13 @@ export default function Home() {
|
||||
}
|
||||
|
||||
async function handleGetAccountStatement(accountNo: string) {
|
||||
router.push(`/accounts/account_statement?accNo=${accountNo}`);
|
||||
if (loadingAccountNo) return;
|
||||
setLoadingAccountNo(accountNo);
|
||||
// simulate loading delay
|
||||
setTimeout(() => {
|
||||
router.push(`/accounts/account_statement?accNo=${accountNo}`);
|
||||
setLoadingAccountNo(null);
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
@@ -116,7 +123,7 @@ export default function Home() {
|
||||
return (
|
||||
<Providers>
|
||||
<Box p={isMobile ? "8px" : "10px"}>
|
||||
<Title order={4} style={{fontSize: isMobile ? "18px" : "22px" }}>
|
||||
<Title order={4} style={{ fontSize: isMobile ? "18px" : "22px" }}>
|
||||
Accounts Overview
|
||||
</Title>
|
||||
|
||||
@@ -202,8 +209,12 @@ export default function Home() {
|
||||
? `₹${Number(selectedDAData?.stAvailableBalance || 0).toLocaleString("en-IN")}`
|
||||
: "****"}
|
||||
</Title>
|
||||
<Button fullWidth mt="xs" onClick={() => handleGetAccountStatement(selectedDA)}>
|
||||
Get Statement
|
||||
<Button fullWidth mt="xs"
|
||||
// loading={loadingAccountNo === selectedDA}
|
||||
disabled={loadingAccountNo === selectedDA}
|
||||
onClick={() => handleGetAccountStatement(selectedDA)}
|
||||
>
|
||||
{loadingAccountNo === selectedDA ? "Loading...Please Wait" : "Get Statement"}
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
@@ -271,8 +282,13 @@ export default function Home() {
|
||||
? `₹${Number(selectedLNData?.stAvailableBalance || 0).toLocaleString("en-IN")}`
|
||||
: "****"}
|
||||
</Title>
|
||||
<Button fullWidth mt="xs" onClick={() => handleGetAccountStatement(selectedLN)}>
|
||||
Get Statement
|
||||
<Button fullWidth mt="xs"
|
||||
// loading={loadingAccountNo === selectedLN}
|
||||
disabled={loadingAccountNo === selectedLN}
|
||||
onClick={() => handleGetAccountStatement(selectedLN)}
|
||||
>
|
||||
{/* Get Statement */}
|
||||
{loadingAccountNo === selectedLN ? "Loading...Please Wait" : "Get Statement"}
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
@@ -356,8 +372,12 @@ export default function Home() {
|
||||
<Title order={2} mt="md">
|
||||
{showBalance ? `₹${Number(selectedDAData?.stAvailableBalance || 0).toLocaleString("en-IN")}` : "****"}
|
||||
</Title>
|
||||
<Button fullWidth mt="xs" onClick={() => handleGetAccountStatement(selectedDA)}>
|
||||
Get Statement
|
||||
<Button fullWidth mt="xs"
|
||||
// loading={loadingAccountNo === selectedDA}
|
||||
disabled={loadingAccountNo === selectedDA}
|
||||
onClick={() => handleGetAccountStatement(selectedDA)}
|
||||
>
|
||||
{loadingAccountNo === selectedDA ? "Loading... Please Wait" : "Get Statement"}
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
@@ -409,8 +429,13 @@ export default function Home() {
|
||||
<Title order={2} mt="md">
|
||||
{showBalance ? `₹${Number(selectedLNData?.stAvailableBalance || 0).toLocaleString("en-IN")}` : "****"}
|
||||
</Title>
|
||||
<Button fullWidth mt="xs" onClick={() => handleGetAccountStatement(selectedLN)}>
|
||||
Get Statement
|
||||
<Button fullWidth mt="xs"
|
||||
// loading={loadingAccountNo === selectedLN}
|
||||
disabled={loadingAccountNo === selectedLN}
|
||||
onClick={() => handleGetAccountStatement(selectedLN)}
|
||||
>
|
||||
{/* Get Statement */}
|
||||
{loadingAccountNo === selectedLN ? "Loading...Please Wait.." : "Get Statement"}
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user