Skip to content

Commit

Permalink
Fix spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapawar1 committed Mar 27, 2024
1 parent 5b5b0d8 commit 9dbefec
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 101 deletions.
2 changes: 1 addition & 1 deletion src/app/auth/login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function LoginScreen() {

<View style={styles.redirectText}>
<Text style={globalStyles.body1}>Don&apos;t have an account?</Text>
<Link style={globalStyles.bodyBoldUnderline} href="/auth/signup">
<Link style={globalStyles.bodyBoldUnderline} href="/auth/onboarding">
Sign Up
</Link>
</View>
Expand Down
199 changes: 101 additions & 98 deletions src/app/auth/onboarding/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import colors from '../../../styles/colors';
import globalStyles from '../../../styles/globalStyles';
import { useSession } from '../../../utils/AuthContext';
import supabase from '../../../utils/supabase';
import { SafeAreaView } from 'react-native-safe-area-context';

function OnboardingScreen() {
const { session, user } = useSession();
Expand Down Expand Up @@ -144,110 +145,112 @@ function OnboardingScreen() {
setBirthdayExists(true);
};

if (!session) {
return <Redirect href="/auth/login" />;
}
// if (!session) {
// return <Redirect href="/auth/login" />;
// }

return (
<ScrollView contentContainerStyle={styles.container}>
<View>
<DateTimePickerModal
isVisible={showDatePicker}
mode="date"
onConfirm={onConfirmDate}
onCancel={() => setShowDatePicker(false)}
date={displayDate}
display="inline"
isDarkModeEnabled={isDark}
themeVariant={isDark ? 'dark' : 'light'}
/>
<Text style={globalStyles.h1}>
Welcome, {user?.user_metadata.username}
</Text>
<Text style={[globalStyles.body1, styles.body1]}>
Input your profile information below.
</Text>
<View style={styles.info}>
<Icon type="material" name="info-outline" color="#797979" />
<Text style={[globalStyles.subtext, styles.subtext]}>
This information is only used for outreach efforts, and will not be
visible to other users on the app.
<SafeAreaView style={styles.container}>
<ScrollView contentContainerStyle={styles.flex}>
<View>
<DateTimePickerModal
isVisible={showDatePicker}
mode="date"
onConfirm={onConfirmDate}
onCancel={() => setShowDatePicker(false)}
date={displayDate}
display="inline"
isDarkModeEnabled={isDark}
themeVariant={isDark ? 'dark' : 'light'}
/>
<Text style={globalStyles.h1}>
Welcome, {user?.user_metadata.username}
</Text>
</View>
<View style={styles.inputContainer}>
<View>
<Pressable
onPress={() => {
setShowDatePicker(!showDatePicker);
}}
>
<View pointerEvents="none">
<UserStringInput
placeholderTextColor={colors.darkGrey}
placeholder="Select Date"
label="Birthday"
value={birthday}
>
<Icon
name="event"
type="material"
color={colors.darkGrey}
style={styles.icon}
/>
</UserStringInput>
</View>
</Pressable>
<Text style={[globalStyles.body1, styles.body1]}>
Input your profile information below.
</Text>
<View style={styles.info}>
<Icon type="material" name="info-outline" color="#797979" />
<Text style={[globalStyles.subtext, styles.subtext]}>
This information is only used for outreach efforts, and will not be
visible to other users on the app.
</Text>
</View>
<View style={styles.inputContainer}>
<View>
<Pressable
onPress={() => {
setShowDatePicker(!showDatePicker);
}}
>
<View pointerEvents="none">
<UserStringInput
placeholderTextColor={colors.darkGrey}
placeholder="Select Date"
label="Birthday"
value={birthday}
>
<Icon
name="event"
type="material"
color={colors.darkGrey}
style={styles.icon}
/>
</UserStringInput>
</View>
</Pressable>
</View>
<UserSelectorInput
options={['Female', 'Male', 'Prefer Not to Disclose', 'Other']}
label="Gender"
value={gender}
setValue={setGender}
/>
<UserSelectorInput
options={['she/her', 'he/him', 'they/them', 'Other']}
label="Pronouns"
value={pronouns}
setValue={setPronouns}
/>
<UserSelectorInput
options={[
'American Indian/Alaska Native',
'Asian',
'Black or African American',
'Native Hawaiian or other Pacific Islander',
'White',
'Prefer Not to Disclose',
]}
label="Race/Ethnicity"
value={raceEthnicity}
setValue={setRaceEthnicity}
/>
</View>
<UserSelectorInput
options={['Female', 'Male', 'Prefer Not to Disclose', 'Other']}
label="Gender"
value={gender}
setValue={setGender}
/>
<UserSelectorInput
options={['she/her', 'he/him', 'they/them', 'Other']}
label="Pronouns"
value={pronouns}
setValue={setPronouns}
/>
<UserSelectorInput
options={[
'American Indian/Alaska Native',
'Asian',
'Black or African American',
'Native Hawaiian or other Pacific Islander',
'White',
'Prefer Not to Disclose',
]}
label="Race/Ethnicity"
value={raceEthnicity}
setValue={setRaceEthnicity}
/>
</View>
</View>

<View>
<View style={styles.updateProfileButton}>
<StyledButton
text="Update profile"
onPress={updateProfileAndGoHome}
disabled={
loading ||
(birthday === '' &&
gender === '' &&
pronouns === '' &&
raceEthnicity === '')
}
/>

<View>
<View style={styles.updateProfileButton}>
<StyledButton
text="Update profile"
onPress={updateProfileAndGoHome}
disabled={
loading ||
(birthday === '' &&
gender === '' &&
pronouns === '' &&
raceEthnicity === '')
}
/>
</View>
<Link
style={[globalStyles.bodyBoldUnderline, styles.skipButton]}
href="/(tabs)/home"
>
Skip For Now
</Link>
</View>
<Link
style={[globalStyles.bodyBoldUnderline, styles.skipButton]}
href="/(tabs)/home"
>
Skip For Now
</Link>
</View>
</ScrollView>
</ScrollView>
</SafeAreaView>
);
}

Expand Down
8 changes: 6 additions & 2 deletions src/app/auth/onboarding/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ import colors from '../../../styles/colors';

export default StyleSheet.create({
container: {
backgroundColor: 'white',
flex: 1,
},
flex: {
flexGrow: 1,
justifyContent: 'space-between',
paddingVertical: 66,
paddingTop: 64,
paddingBottom: 54,
paddingLeft: 43,
paddingRight: 44,
backgroundColor: 'white',
},
inputContainer: {
flex: 1,
Expand Down

0 comments on commit 9dbefec

Please sign in to comment.