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

Feat/yixuan+william/auth #9

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Feat/yixuan+william/auth #9

wants to merge 18 commits into from

Conversation

yxli001
Copy link

@yxli001 yxli001 commented Jan 29, 2025

Tracking Info

Resolves #4

Changes

Main Changes

  • Created landing page, login page, and a temporary home/loading page
  • Login page handles both input validation errors and Firebase errors and passes them onto the inputs to be displayed
  • Home/loading page redirects to landing page if not logged in, and all auth-related pages redirect to loading page if already logged in
  • New Components:
    • Button: button with base styles that can handle page navigation with the href prop and/or press events with the onPress prop
      • All additional props and stylings will be passed on to the internal TouchableCapacity component
    • Inputbox: combines input label, input box, error messages, and various password-related components (visibility toggle, forgot password button)
      • label, placeholder, and errorMessage props, self-explanatory, errorMessage and validation state should be handled by the parent component
      • value and onChangeText props handle state of the input
      • containerStyle prop passes styles onto the container View (containing all the components)
      • labelStyle prop passes styles onto the label Text component
      • style prop passes styles onto the TextInput component
      • isPassword and onForgotPassword props toggle and define password input functionalities
      • All additional props passed down to the TextInput component (NOT the container)
  • Firebase auth-related functions in src/lib/auth.ts
    • Response and error types defined and documented in this file
    • Sample usage in src/app/(auth)/login.tsx
  • UserContext and UserContextProvider available in src/contexts/userContext.ts
    • Should be wrapped around everything in the root layout, as used in src/app/_layout.tsx
    • onAuthStateChanged listener is set up in this file - initial call to our API's whoami route should probably happen here

Additional Changes

  • react-native-svg-transformer set up to render svg files, sample usage with the Mascots import in src/app/index.ts
  • zod set up for validation, sample usage in src/app/(auth)/login.tsx

Testing

  • Manual testing on both iOS and Android

Confirmation of Change

  • NOTE: remember to npm install, and the android folder may need to be deleted and rebuilt for changes to take affect

Landing page

image

Login page

image

Login page with errors

image

Temp home/loading page

image

Copy link

@yotzkim yotzkim left a comment

Choose a reason for hiding this comment

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

Pulled and tested locally, lgtm!

Copy link

@JordanJunaidi JordanJunaidi left a comment

Choose a reason for hiding this comment

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

Tested locally on ios and android. Login page looks good but I don't see the landing page (not sure if that's intentional)

@yxli001
Copy link
Author

yxli001 commented Feb 11, 2025

Tested locally on ios and android. Login page looks good but I don't see the landing page (not sure if that's intentional)

Harsh and Joanne ended up deciding to remove the landing page because it makes more sense logistically to start on the login page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Login Flow
5 participants