Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Add New Card Functionality with QR Code Scanner #110

Closed
wants to merge 7 commits into from

Conversation

munezeromicha
Copy link
Contributor

Overview
This pull request introduces a new feature that allows patients to add a new card within the application. The feature includes a QR code scanner for easy card information entry, and fields for manual input of the cardholder's name, card number, expiry date, and CVV number.

Features Added
QR Code Scanner:

  • A QR code scanner button is included at the top right corner of the screen.
  • When tapped, it navigates the user to the QR code scanner page for quick card information capture.

Cardholder Name Input:

  • A text input field where users can enter the cardholder's name.

Card Number Input:

  • A text input field for entering the card number.
  • The input automatically formats the card number into groups of four digits for better readability.

Expiry Date Input:

  • A date picker for selecting the card's expiry date.
  • The expiry date is displayed in a readable format and can be changed by tapping the calendar icon.

CVV Number Input:

  • A text input field for entering the CVV number.
  • The input restricts the CVV number to a maximum of 3 or 4 digits based on card type.

Styling and Theming:

  • The feature is styled to be consistent with the application's dark and light themes.
  • Various UI elements adapt their colors based on the current theme.

Technical Changes

New Components and Dependencies:

  • Added SvgXml components for rendering SVG icons.
  • Used react-native-community/datetimepicker for the date picker.
  • Updated imports to include necessary icons and assets.

State Management:

  • Added state variables to manage card details (cardNumber, CVVNumber, date).
  • Utilized useState for local state and useEffect for side effects.

Event Handlers:

  • handleCardNumberChange for formatting card number input.
  • handleCVVChange for restricting CVV input length.
  • onDateChange for updating the selected expiry date.

UI Improvements:

  • Positioned the QR code scanner button for easy access.
  • Ensured inputs are user-friendly and clearly labeled.

ScreenShoots:

Screenshot 1 Screenshot 2

@munezeromicha munezeromicha linked an issue May 29, 2024 that may be closed by this pull request
@munezeromicha munezeromicha self-assigned this May 29, 2024
@munezeromicha munezeromicha added the Fix A fix to a problem label May 29, 2024
@munezeromicha munezeromicha added this to the Mobile App UI milestone May 29, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.22%. Comparing base (3ec9fe1) to head (e70330e).
Report is 9 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #110   +/-   ##
========================================
  Coverage    72.22%   72.22%           
========================================
  Files            3        3           
  Lines           18       18           
  Branches         3        3           
========================================
  Hits            13       13           
  Misses           5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@munezeromicha munezeromicha added Need Review Requires reviews and removed Fix A fix to a problem labels May 31, 2024
@Nkbtemmy Nkbtemmy added the Need Rebase Rebase from develop label May 31, 2024
@munezeromicha munezeromicha force-pushed the fix-add-new-card branch 2 times, most recently from 435e229 to c459567 Compare May 31, 2024 11:24
@munezeromicha munezeromicha removed the Need Rebase Rebase from develop label May 31, 2024
@Irirwanirira Irirwanirira added Fix A fix to a problem Progress task in progress and removed Need Review Requires reviews labels May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix A fix to a problem Progress task in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix: Add New Card Feature with QR Code Scanner
7 participants