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

Add input validation to our input components #14

Closed
AmanKAggarwal opened this issue Jan 20, 2023 · 0 comments · Fixed by #23
Closed

Add input validation to our input components #14

AmanKAggarwal opened this issue Jan 20, 2023 · 0 comments · Fixed by #23
Assignees
Labels
product:ios-app Issues for ALUM mobile app stack:frontend All issues strictly involving work frontend (react or swift)

Comments

@AmanKAggarwal
Copy link
Collaborator

PR #11 creates an Input Text Component. When a user enters some text, we want to be able to validate it and render out relevant messages.

Look at the image below -
image
Note the different types of error messages (look at the colors green and red) and also how some have an icon at the beginning and some don't.

Example uses

image

  • Note that the functionality you add to make this happen should be easily reusable at different location. You can come up with the best way to organize code.
  • I recommend looking at this term called regular expressions for validation.
  • See if you can somehow have the parent component of the input field (one that uses it) define the entire error message and its styling (while building components always try to limit the work done by the component as much as possible)

Resources

  • In addition to google, ask ChatGPT - "swiftui how to add input validation" and see it do the magic! Best way to use ChatGPT is to always take its answers with a grain of salt so beware. But feel free to ask it any question you have and it has never disappointed me yet
@AmanKAggarwal AmanKAggarwal added the stack:frontend All issues strictly involving work frontend (react or swift) label Jan 20, 2023
@AmanKAggarwal AmanKAggarwal added this to the MVP milestone Apr 11, 2023
@AmanKAggarwal AmanKAggarwal added the product:ios-app Issues for ALUM mobile app label Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product:ios-app Issues for ALUM mobile app stack:frontend All issues strictly involving work frontend (react or swift)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants