Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 31 additions & 16 deletions features/digikhata/page-components/steps/FundTransferStep.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { TimeIcon } from "@chakra-ui/icons";
import {
Alert,
AlertIcon,
Expand Down Expand Up @@ -175,7 +176,7 @@ export const FundTransferStep = ({
null
);
const [otpRefId, setOtpRefId] = useState(null);
const [isSchedule, setIsSchedule] = useState(false);
const [isSchedule, setIsSchedule] = useState(true);

if (!recipient) {
return (
Expand Down Expand Up @@ -323,7 +324,10 @@ export const FundTransferStep = ({
const isAmountValid =
!isNaN(numAmount) && numAmount >= MIN_AMOUNT && numAmount <= MAX_AMOUNT;
const canSubmit =
isPinComplete && isAmountValid && !isSendingTransactionOtp;
isPinComplete &&
isAmountValid &&
!isSendingTransactionOtp &&
isSchedule;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The canSubmit logic now requires isSchedule to be true. If isSchedule is a toggle that the user can turn off, this logic will prevent the user from submitting a transfer when isSchedule is false. This seems to be a functional bug if the intention is to allow transfers regardless of the schedule toggle state.


// Non-idle terminal states (pending / success / failed)
if (transferStatus !== "idle") {
Expand Down Expand Up @@ -442,22 +446,33 @@ export const FundTransferStep = ({
</Box>

{/* Schedule Transfer */}
<Flex align="center" justify="space-between">
<Box>
<Flex
bg={isSchedule ? "orange.100" : "shade"}
borderRadius="10"
p={4}
border="1px solid"
borderColor={isSchedule ? "orange" : "blackAlpha.300"}
transition="all 0.2s ease-out"
direction="column"
>
<Flex align="center" gap={2} mb={1}>
<TimeIcon
color={isSchedule ? "orange.500" : "gray.500"}
/>
<Text fontSize="sm" fontWeight="medium" color="dark">
Schedule
Schedule Transfer
</Text>
<Text fontSize="xs" color="light">
Schedule this transfer to be sent automatically
after recipient verification.
</Text>
</Box>
<Switch
size={{ base: "sm", md: "md" }}
variant="primary"
isChecked={isSchedule}
onChange={() => setIsSchedule((prev) => !prev)}
/>
<Switch
size={{ base: "sm", md: "md" }}
variant="primary"
isChecked={isSchedule}
onChange={() => setIsSchedule((prev) => !prev)}
/>
</Flex>
<Text fontSize="sm" color="light">
This recipient is newly-added. Send automatically after
the cooling period (usually 5 minutes).
</Text>
</Flex>

<Button
Expand Down
78 changes: 65 additions & 13 deletions features/digikhata/page-components/steps/LoadWalletStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Button,
Flex,
Input,
Link,
NumberInput,
NumberInputField,
Text,
Expand Down Expand Up @@ -272,16 +273,42 @@ export const LoadWalletStep = ({

<Box>
{/* Info Note */}
<Alert status="info" borderRadius="10" mb={3}>
<AlertIcon />
<Alert
bg="primary.DEFAULT"
status="info"
borderRadius="10"
mb={3}
color="white"
>
<AlertIcon color="white" />
<Box>
<Text fontWeight="semibold" fontSize="sm">
Don't have a DigiKhata VPA yet?
</Text>
<Text fontSize="sm" color="light">
To get your VPA ID, download the{" "}
<strong>DigiKhata app</strong>, register
yourself, and find your VPA ID from the app.
<Text fontSize="sm">
To get your VPA ID, download the DigiKhata
app from{" "}
<Link
href="https://play.google.com/store/apps/details?id=com.paypointz.wallet&hl=en"
isExternal
fontWeight="bold"
textDecoration="underline"
color="blue.300"
>
Google Play Store
</Link>{" "}
or{" "}
<Link
href="https://apps.apple.com/in/app/digi-khata/id1194920306"
isExternal
fontWeight="bold"
textDecoration="underline"
color="blue.300"
>
Apple App Store
</Link>
, register yourself, and find your VPA ID
from the app.
</Text>
</Box>
</Alert>
Expand Down Expand Up @@ -361,17 +388,42 @@ export const LoadWalletStep = ({
</Flex>

{/* Info Note */}
<Alert status="info" borderRadius="10" mb={3}>
<AlertIcon />
<Alert
bg="primary.DEFAULT"
status="info"
borderRadius="10"
mb={3}
color="white"
>
<AlertIcon color="white" />
<Box>
<Text fontWeight="semibold" fontSize="sm">
Don't have a DigiKhata Virtual Account yet?
</Text>
<Text fontSize="sm" color="light">
To get your Virtual Account, download the{" "}
<strong>DigiKhata app</strong>, register
yourself, and find your Virtual Account from the
app.
<Text fontSize="sm">
To get your VPA ID, download the DigiKhata app
from{" "}
<Link
href="https://play.google.com/store/apps/details?id=com.paypointz.wallet&hl=en"
isExternal
fontWeight="bold"
textDecoration="underline"
color="blue.300"
>
Google Play Store
</Link>{" "}
or{" "}
<Link
href="https://apps.apple.com/in/app/digi-khata/id1194920306"
isExternal
fontWeight="bold"
textDecoration="underline"
color="blue.300"
>
Apple App Store
</Link>
, register yourself, and find your VPA ID from
the app.
</Text>
</Box>
</Alert>
Expand Down