Skip to content

Commit

Permalink
Merge branch 'main' into justin/signup-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapawar1 authored Apr 19, 2024
2 parents e14aa52 + 9cc1b1a commit f8d8670
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 16 deletions.
39 changes: 29 additions & 10 deletions src/app/(tabs)/story/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ function StoryScreen() {
style={styles.authorImage}
source={{ uri: story.author_image ? story.author_image : '' }}
/>
<Text style={globalStyles.subHeading1Bold}>
<Text
style={[
globalStyles.subHeading1Bold,
{ textDecorationLine: 'underline' },
]}
>
By {story.author_name}
</Text>
</View>
Expand Down Expand Up @@ -161,15 +166,29 @@ function StoryScreen() {
systemFonts={fonts}
/>

<View style={styles.author}>
<Image
style={styles.authorImage}
source={{ uri: story.author_image }}
/>
<Text style={globalStyles.subHeading1Bold}>
By {story.author_name}
</Text>
</View>
<TouchableOpacity
onPress={() => {
router.push({
pathname: '/author',
params: { author: story.author_id.toString() },
});
}}
>
<View style={styles.author}>
<Image
style={styles.authorImage}
source={{ uri: story.author_image ? story.author_image : '' }}
/>
<Text
style={[
globalStyles.subHeading1Bold,
{ textDecorationLine: 'underline' },
]}
>
By {story.author_name}
</Text>
</View>
</TouchableOpacity>

<Button
textColor="black"
Expand Down
13 changes: 13 additions & 0 deletions src/app/auth/onboarding/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function OnboardingScreen() {
const [pronouns, setPronouns] = useState('');
const [birthday, setBirthday] = useState('');
const [birthdayExists, setBirthdayExists] = useState(false);
const [birthdayChanged, setBirthdayChanged] = useState(false);
const [gender, setGender] = useState('');
const [raceEthnicity, setRaceEthnicity] = useState('');
const [showDatePicker, setShowDatePicker] = useState(false);
Expand Down Expand Up @@ -142,6 +143,7 @@ function OnboardingScreen() {
};

const onConfirmDate = (date: Date) => {
setBirthdayChanged(true);
setShowDatePicker(false);
setBirthday(date.toLocaleDateString());
setDisplayDate(date);
Expand Down Expand Up @@ -235,6 +237,16 @@ function OnboardingScreen() {
</View>

<View>
{birthdayChanged && (
<View style={[styles.info, styles.warning]}>
<Icon type="material" name="info-outline" color="#797979" />
<Text style={[globalStyles.subtext, styles.subtext]}>
You can only input your birthday once. Please make sure the date
is correct before saving as you will not be able to change your
birthday in the future.
</Text>
</View>
)}
<View style={styles.updateProfileButton}>
<StyledButton
text="Update profile"
Expand All @@ -248,6 +260,7 @@ function OnboardingScreen() {
}
/>
</View>

<Link
style={[globalStyles.bodyBoldUnderline, styles.skipButton]}
href="/(tabs)/home"
Expand Down
4 changes: 4 additions & 0 deletions src/app/auth/onboarding/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export default StyleSheet.create({
body1: {
marginTop: 26,
},
warning: {
marginTop: 40,
marginBottom: 24,
},
info: {
flexDirection: 'row',
marginTop: 12,
Expand Down
56 changes: 50 additions & 6 deletions src/app/auth/signup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,56 @@ function SignUpScreen() {
{'Read stories from \nyoung creators'}
</Text>

<UserStringInput
placeholder="Username"
label="Username"
placeholderTextColor={colors.darkGrey}
onChange={setAndCheckUsername}
value={username}
<UserStringInput
placeholder="First Name"
label="First Name"
placeholderTextColor={colors.darkGrey}
onChange={text => setFirstName(text.replaceAll(/[^a-zA-Z]/g, ''))}
value={firstName}
/>
<UserStringInput
placeholder="Last Name"
label="Last Name"
placeholderTextColor={colors.darkGrey}
onChange={text => setLastName(text.replaceAll(/[^a-zA-Z]/g, ''))}
value={lastName}
/>
<UserStringInput
placeholder="Email"
label="Email"
placeholderTextColor={colors.darkGrey}
onChange={setAndCheckEmail}
value={email}
attributes={{
textContentType: 'emailAddress',
secureTextEntry: false,
}}
/>
{emailError && (
<Text style={[globalStyles.errorMessage, styles.inputError]}>
{emailError}
</Text>
)}

<UserStringInput
placeholder="Password"
label="Password"
placeholderTextColor={colors.darkGrey}
onChange={text => {
setPassword(text);
checkPassword(text);
}}
value={password}
attributes={{
textContentType: 'password',
secureTextEntry: passwordTextHidden,
}}
>
<RNEIcon
name={passwordTextHidden ? 'visibility-off' : 'visibility'}
type="material"
style={styles.icon}
onPress={() => setPasswordTextHidden(!passwordTextHidden)}
/>
{usernameError && (
<Text style={[globalStyles.errorMessage, styles.inputError]}>
Expand Down

0 comments on commit f8d8670

Please sign in to comment.