refactor: Change codebase as per requirement

This commit is contained in:
2025-08-08 17:23:38 +05:30
parent 2e27bc4776
commit c9181881e0
7 changed files with 23 additions and 22 deletions

View File

@@ -44,7 +44,7 @@ export default function AccountStatementPage() {
.then(res => res.json())
.then(data => {
if (Array.isArray(data)) {
const last5 = data.slice(-5).reverse();
const last5 = data.slice(0,5);
setTransactions(last5);
}
})

View File

@@ -16,7 +16,7 @@ interface accountData {
export default function QuickPay() {
const router = useRouter();
const [bankType, setBankType] = useState("own");
// const [bankType, setBankType] = useState("own");
const [authorized, setAuthorized] = useState<boolean | null>(null);
const [accountData, setAccountData] = useState<accountData[]>([]);
const [selectedAccNo, setSelectedAccNo] = useState<string | null>(null);
@@ -150,7 +150,7 @@ export default function QuickPay() {
};
async function handleProceed() {
if (!selectedAccNo || !beneficiaryAcc || !confirmBeneficiaryAcc || !beneficiaryType || !amount ) {
if (!selectedAccNo || !beneficiaryAcc || !confirmBeneficiaryAcc || !beneficiaryType || !amount || !remarks) {
notifications.show({
title: "Validation Error",
message: "Please fill all required fields",
@@ -174,7 +174,6 @@ export default function QuickPay() {
color: "red",
});
return;
}
if (!showOtpField && !showTxnPassword && !showConfirmModel) {
@@ -316,14 +315,7 @@ export default function QuickPay() {
<Title order={3} mb="md">
Quick Pay
</Title>
<Radio.Group value={bankType} onChange={setBankType} name="bankType" withAsterisk mb="md">
<Group justify="center">
<Radio value="own" label="Own Bank" />
<Radio value="outside" label="Outside Bank" />
</Group>
</Radio.Group>
{bankType === "own" ? (
<div style={{ maxHeight: "320px", overflowY: "auto" }}>
<Stack gap="xs">
<Group grow>
@@ -414,6 +406,7 @@ export default function QuickPay() {
onChange={(e) => setRemarks(e.currentTarget.value)}
// withAsterisk
readOnly={showOtpField}
withAsterisk
/>
</Group>
<Group grow>
@@ -456,11 +449,11 @@ export default function QuickPay() {
</Group>
</Stack>
</div>
) : (
{/* ) : (
<div>
<OutsideQuickPay />
</div>
)}
)} */}
</Paper>
</>
);

View File

@@ -81,7 +81,7 @@ export default function SendToBeneficiaryOwn() {
bankType === 'own' ? ben_acc.stBankName === 'Kangra Central Co-operative Bank' : true)
.map((ben_acc) => ({
value: ben_acc.stBenAccountNo,
label: ben_acc.stBenAccountNo,
label: `${ben_acc.stBenAccountNo}-${ben_acc.stBenName}`,
}));
const handleBeneficiary = (benAcc: string | null) => {
@@ -317,7 +317,7 @@ export default function SendToBeneficiaryOwn() {
readOnly={isVisibilityLocked}
/>
<Select
label="Beneficiary Account No"
label="Select Beneficiary Account No"
placeholder="Choose beneficiary account number"
data={benAccountOption}
value={beneficiaryAcc}

View File

@@ -192,7 +192,7 @@ export default function Home() {
{/* Important Links Card */}
<Paper p="md" radius="md" style={{ width: 300, backgroundColor: '#FFFFFF', marginLeft: '130px', border: '1px solid grey' }}>
<Title order={5} mb="sm">Important Links</Title>
<Title order={5} mb="sm">Quick Links</Title>
<Stack gap="xs">
<Button variant="light" color="blue" fullWidth>Loan EMI Calculator</Button>
<Button variant="light" color="blue" fullWidth>Branch Locator</Button>
@@ -205,7 +205,7 @@ export default function Home() {
{/* Send Money Section */}
<div style={{ padding: "20px", display: "flex", justifyContent: "left" }}>
<Box>
{/* <Box>
<Title order={4}>Send Money</Title>
<Group mt="sm">
<Select
@@ -221,7 +221,13 @@ export default function Home() {
<Input placeholder="₹0.00" style={{ width: 100 }} />
<Button>Proceed</Button>
</Group>
</Box>
</Box> */}
<Stack>
<Text fw={700}> ** Book Balance includes uncleared effect.</Text>
<Text fw={700}> ** Click on the "Show Balance" to display balance for the Deposit and Loan account.</Text>
{/* <Text fw={700}> ** Click on the "Get Statement" to display last 5 transactions.</Text> */}
<Text></Text>
</Stack>
</div>
</div>
</Providers>