From df3fa3532f0a95a826e0996b89eee85309b8c866 Mon Sep 17 00:00:00 2001 From: "tomosa.sarkar" Date: Thu, 10 Jul 2025 14:57:42 +0530 Subject: [PATCH] Fix: Home design --- instruction.txt | 6 +- src/app/home/layout.tsx | 87 ++++++++++ src/app/home/page.tsx | 343 +++++++++++++++++----------------------- src/app/login/page.tsx | 7 +- 4 files changed, 240 insertions(+), 203 deletions(-) create mode 100644 src/app/home/layout.tsx diff --git a/instruction.txt b/instruction.txt index 28357f2..429ac69 100644 --- a/instruction.txt +++ b/instruction.txt @@ -4,9 +4,11 @@ aws ssm start-session --target i-0c850dcf8b85b1447 --document-name --profile kccb AWS-StartPortForwardingSession --parameters "portNumber"=["8080"],"localPortNumber"=["8080"] -- run the api in localhost +- run the api in localhost then port forward to Postgres aws ssm start-session --target i-0c850dcf8b85b1447 --document-name --profile kccb AWS-StartPortForwardingSession --parameters "portNumber"=["5432"],"localPortNumber"=["5431"] - + +- For CBS port forward + aws ssm start-session --target i-0c850dcf8b85b1447 --document-name --profile kccb AWS-StartPortForwardingSession --parameters "portNumber"=["8686"],"localPortNumber"=["8686"] ______________________________________________________________________ For database: diff --git a/src/app/home/layout.tsx b/src/app/home/layout.tsx new file mode 100644 index 0000000..3fcf734 --- /dev/null +++ b/src/app/home/layout.tsx @@ -0,0 +1,87 @@ +"use client"; +import React from 'react'; +import { Box, Button, Flex, Group, Image, Text } from '@mantine/core'; +import { IconBook, IconCurrencyRupee, IconHome, IconLogout, IconPhoneFilled, IconSettings } from '@tabler/icons-react'; +import Link from 'next/link'; +import { useRouter } from "next/navigation"; +import { Providers } from '../providers'; +import logo from '@/app/image/logo.jpg'; +import NextImage from 'next/image'; + +export default function RootLayout({ children }: { children: React.ReactNode }) { + const router = useRouter(); + + async function handleLogout(e: React.FormEvent) { + e.preventDefault(); + localStorage.removeItem("access_token"); + router.push("/login") + } + return ( + + + +
+ {/* Image -Logo */} + + ebanking + + + Toll Free No : 1800-180-8008 + + +
+ + + + + + + + + + + + + + + + + +
+
{children}
+ {/* Footer */} + + © 2025 Kangra Central Co- Operative Bank + +
+
+ + + ); +} diff --git a/src/app/home/page.tsx b/src/app/home/page.tsx index 89aba0b..a1548a0 100644 --- a/src/app/home/page.tsx +++ b/src/app/home/page.tsx @@ -1,13 +1,12 @@ "use client"; import React from 'react'; -import { AppShell, Button, Input, Group, Stack, Tooltip, UnstyledButton, Text, Avatar, Title, Divider, Box, Select, Paper, Image, Switch, Flex, TextInput, Center } from '@mantine/core'; -import { IconBook, IconBuildingBank, IconCurrencyRupee, IconEye, IconHome, IconLogout, IconPhoneFilled, IconSettings } from '@tabler/icons-react'; +import { Button, Input, Group, Stack, Text, Title, Box, Select, Paper,Switch} from '@mantine/core'; +import { IconBuildingBank, IconEye} from '@tabler/icons-react'; import { useRouter } from "next/navigation"; import { useEffect, useState } from "react"; import { Providers } from "../providers"; -import logo from '@/app/image/logo.jpg'; -import NextImage from 'next/image'; + export default function Home() { const [authorized, SetAuthorized] = useState(null); @@ -43,201 +42,151 @@ export default function Home() { } }, []); - if (authorized) { - return ( - +if (authorized) { + return ( + +
- - ebanking - - - Toll Free No : 1800-180-8008 - - -
- - - - - {/* */} - - - -
-
- Welcome, Rajat Kumar Maharana - {/*   */} - Last logged in at 29/06/25, 05:35 PM -
- - - Show Balance - setShowBalance(event.currentTarget.checked)} /> - -
- - - - - - Deposit Account - ({ - value: acc.stAccountNo, - label: acc.stAccountNo - }))} - value={selectedLN} - // @ts-ignore - onChange={setSelectedLN} - size="xs" - styles={{ - input: { - backgroundColor: "white", - color: "black", - marginLeft: 25, - width: 125 - } - }} - /> - - {Number(selectedLNData?.stAccountNo || 0)} - - {showBalance ? `₹${Number(selectedLNData?.stAvailableBalance || 0).toLocaleString('en-IN')}` : "****"} - - - - - Important Links - {/* Loan EMI Calculator */} - - - - - - - {/* - - - - - */} - - -
-
- - Send Money - - - - - - -
- - © 2025 Kangra Central Co- Operative Bank - + flexDirection: "column", + justifyContent: "left", + }} + > + Welcome, Rajat Kumar Maharana + {/*   */} + Last logged in at 29/06/25, 05:35 PM
- - ); - } + + + Show Balance + setShowBalance(event.currentTarget.checked)} /> + +
+ + + + + + Deposit Account + ({ + value: acc.stAccountNo, + label: acc.stAccountNo + }))} + value={selectedLN} + // @ts-ignore + onChange={setSelectedLN} + size="xs" + styles={{ + input: { + backgroundColor: "white", + color: "black", + marginLeft: 25, + width: 125 + } + }} + /> + + {Number(selectedLNData?.stAccountNo || 0)} + + {showBalance ? `₹${Number(selectedLNData?.stAvailableBalance || 0).toLocaleString('en-IN')}` : "****"} + + + + + Important Links + {/* Loan EMI Calculator */} + + + + + + + {/* + + + + + */} + + +
+
+ + Send Money + + + + + + +
+
+
+ ); +} } \ No newline at end of file diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index f4d15d3..042174f 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -40,13 +40,10 @@ export default function Login() { async function handleLogin(e: React.FormEvent) { e.preventDefault(); - setIsLogging(true); - const onlyDigit = /^\d{11}$/; if (!onlyDigit.test(CIF)) { setError('Input value must be 11 digit'); } - if (inputCaptcha !== captcha) { notifications.show({ withBorder: true, @@ -68,6 +65,7 @@ export default function Login() { }), }); const data = await response.json(); + setIsLogging(true); if (response.ok) { console.log(data); const token = data.token; @@ -81,6 +79,7 @@ export default function Login() { } else { + setIsLogging(false); notifications.show({ withBorder: true, color: "red", @@ -255,7 +254,7 @@ export default function Login() { />