Skip to content

feat(Onboarding) UI update and basic text input verification #24

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spoonprogram
Copy link

@spoonprogram spoonprogram commented Jul 16, 2023

Affect Files:
packages/app/screens/onboarding/OnboardingStack.js

Screens:

  • a ScrollView that wraps around 3 child components are styled to look like individual screen where users can make text inputs(school, birthday, interests)
  • users can freely swipe horizontally between the three screens
  • last screen contains a submit button that will direct users to the feed screen if all textboxes are filled
  • still hard coded to always send user to onboarding screen for testing purposes

Bottom Header:

  • contains a working skip button that takes the user to the feed screen
  • next button and pagination indicator do not work for now

Textbox Verification System:

  • if textboxes are not filled with any characters user will not be able to proceed to the feed screen and error messages will show underneath textboxes

Issues:

  • still using async storage for tracking user's first time login instead of secure storage

Fixes:

-Fixed keyboard from pushing up bottom header when selecting a textbox

@nappalion nappalion self-requested a review August 9, 2023 04:01
nappalion

This comment was marked as outdated.

Copy link
Member

@nappalion nappalion left a comment

Choose a reason for hiding this comment

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

Otherwise, it looks good. The base functionality is there, and I like the use of ScrollView for the sliding pages. Not sure if it should connect to the backend yet.

if (localAuthToken) {
const payload = await getUserInfo(localAuthToken);
const token = await AsyncStorage.getItem('token');
const isFirstTime = await AsyncStorage.getItem('isFirstTime');
Copy link
Member

@nappalion nappalion Aug 11, 2023

Choose a reason for hiding this comment

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

Should isFirstTime be stored in AsyncStorage? I'm guessing it should be stored on a database somewhere so that the user only needs to do onboarding once. With AsyncStorage, if the user were to log on in another device, they would see the onboarding screen again.
You can remove the AsyncStorage code for now. Luke will add a isNewUser boolean property to google and local login routes.

Comment on lines +70 to +82
<View style={styles.slide}>
<Text>When's your birthday?</Text>
<TextInput
style={styles.input}
placeholder= "MM/DD/YYYY"
onChangeText={setBirthday}
value={birthday}
/>
{error2 ? (
<Text style={styles.error}>*Your Birthday is Required</Text>
) : null
}
</View>
Copy link
Member

Choose a reason for hiding this comment

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

There should be input validation checking if the correct values are typed in for Birthday (maybe School too?). A date picker would also be a good choice for the Birthday.

Comment on lines +84 to +103
<View style={styles.slide}>
<Text>List some of your interest:</Text>
<TextInput
style={styles.input}
placeholder= "Your Interests"
onChangeText={setInterests}
value={interests}
/>
{error3 ? (
<Text style={styles.error}>*Your Interests are Required</Text>
) : null
}
<TouchableOpacity style={styles.button} onPress={handleSubmit}>
<Text style={styles.buttonText}>Submit</Text>
</TouchableOpacity>
{error4 ? (
<Text style={styles.error}>*Missing Required Responses</Text>
) : null
}
</View>
Copy link
Member

Choose a reason for hiding this comment

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

For the interests, the Twitter reference you posted in the RFC looks good. You can try implementing selecting interests like that with mock data.

Comment on lines +56 to +68
<View style={styles.slide}>
<Text>Where do you go to school?</Text>
<TextInput
style={styles.input}
placeholder= "Your School"
onChangeText={setSchool}
value={school}
/>
{error2 ? (
<Text style={styles.error}>*Your School is Required</Text>
) : null
}
</View>
Copy link
Member

Choose a reason for hiding this comment

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

This is more optional, but I've seen other websites recommend a list of schools as you type.

Comment on lines +112 to +114
<TouchableOpacity style={styles.nextBtn}>
<Text>NEXT</Text>
</TouchableOpacity>
Copy link
Member

Choose a reason for hiding this comment

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

Next button doesn't work yet.

Comment on lines +109 to +111
<View style={styles.indicator}></View>
<View style={styles.indicator}></View>
<View style={styles.indicator}></View>
Copy link
Member

Choose a reason for hiding this comment

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

The page indicators on the bottom should show you what page you're on (maybe with a change of color or size).

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

Successfully merging this pull request may close these issues.

3 participants