Conversation
…-schedule ui: add note in virtual account
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request adds an informational alert to the LoadWalletStep component to guide users on obtaining a DigiKhata Virtual Account. The review suggests refactoring the new alert and an existing similar alert into a single reusable component to improve maintainability and reduce code duplication.
| <Alert status="info" borderRadius="10" mb={3}> | ||
| <AlertIcon /> | ||
| <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> | ||
| </Box> | ||
| </Alert> |
There was a problem hiding this comment.
This Alert component is very similar to the one used for the UPI section (lines 275-287). To improve maintainability and reduce code duplication, consider creating a reusable component that can be used in both places.
For example, you could create a RegistrationPrompt component:
const RegistrationPrompt = ({ accountType, accountIdentifier }: { accountType: string, accountIdentifier: string }) => (
<Alert status="info" borderRadius="10" mb={3}>
<AlertIcon />
<Box>
<Text fontWeight="semibold" fontSize="sm">
Don't have a DigiKhata {accountType} yet?
</Text>
<Text fontSize="sm" color="light">
To get your {accountIdentifier}, download the{" "}
<strong>DigiKhata app</strong>, register yourself, and find your{" "}
{accountIdentifier} from the app.
</Text>
</Box>
</Alert>
);You could then use it here as:
<RegistrationPrompt accountType="Virtual Account" accountIdentifier="Virtual Account" />
And refactor the existing alert for UPI to use:
<RegistrationPrompt accountType="VPA" accountIdentifier="VPA ID" />
This would make the code more DRY (Don't Repeat Yourself) and easier to manage.
Description
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
🚨 Checklist:
Further comments
🙏 Thank you!
Thank you for contributing to this project. We appreciate your time and effort. 🎉