Skip to content

Commit

Permalink
[feat] apply headers to every screen in the auth flow.
Browse files Browse the repository at this point in the history
  • Loading branch information
ronniebeggs committed Apr 24, 2024
1 parent dc4c3bf commit 0e7057c
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 49 deletions.
3 changes: 0 additions & 3 deletions src/app/(Authentication)/Login/Email/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ export default function LoginScreen() {

return (
<View style={styles.container}>
<TouchableOpacity style={styles.backButton} onPress={() => router.back()}>
<Text style={styles.backText}>Back</Text>
</TouchableOpacity>
<Text style={styles.instructionText}>
Please enter your email address.
</Text>
Expand Down
3 changes: 0 additions & 3 deletions src/app/(Authentication)/Login/Password/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ export default function LoginScreen() {

return (
<View style={styles.container}>
<TouchableOpacity style={styles.backButton} onPress={() => router.back()}>
<Text style={styles.backText}>Back</Text>
</TouchableOpacity>
<Text style={styles.instructionText}>Please enter your password.</Text>

<View style={styles.inputBox}>
Expand Down
6 changes: 0 additions & 6 deletions src/app/(Authentication)/OTPFlow/OTPEmailInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ export default function OTPEmailInput() {
return (
<View style={styles.container}>
<View style={styles.innerContainer}>
<TouchableOpacity
style={styles.backButton}
onPress={() => router.back()}
>
<Text style={styles.backText}>Back</Text>
</TouchableOpacity>
<View>
<Text style={styles.instructionText}>
Please enter the email you used to create your account.
Expand Down
8 changes: 0 additions & 8 deletions src/app/(Authentication)/OTPFlow/OTPNewPassword/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@ export default function SignUpScreen() {

return (
<View style={styles.container}>
<View style={styles.header}>
<TouchableOpacity
style={styles.backButton}
onPress={() => router.back()}
>
<Text style={styles.backText}>Back</Text>
</TouchableOpacity>
</View>
<Text style={styles.instructionText}>Create a new password.</Text>

<View style={styles.inputBox}>
Expand Down
5 changes: 0 additions & 5 deletions src/app/(Authentication)/OTPFlow/OTPVerify/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ export default function OTPFlow() {

return (
<View style={styles.container}>
<View style={styles.header}>
<TouchableOpacity onPress={() => router.back()}>
<Text style={styles.backText}>Back</Text>
</TouchableOpacity>
</View>
<View style={styles.contentContainer}>
<View style={styles.instructionContainer}>
<Text style={styles.headerText}>Enter verification code.</Text>
Expand Down
1 change: 0 additions & 1 deletion src/app/(Authentication)/SignUp/Address/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export default function SignUpScreen() {

return (
<View style={styles.container}>
<View style={styles.header} />
<Text style={styles.instructionText}>Last, enter your address.</Text>

<View style={styles.inputBox}>
Expand Down
8 changes: 0 additions & 8 deletions src/app/(Authentication)/SignUp/Email/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ export default function SignUpScreen() {

return (
<View style={styles.container}>
<View style={styles.header}>
<TouchableOpacity
style={styles.backButton}
onPress={() => router.back()}
>
<Text style={styles.backText}>Back</Text>
</TouchableOpacity>
</View>
<Text style={styles.instructionText}>Create your account.</Text>
<View style={styles.inputBox}>
<AuthInput
Expand Down
8 changes: 0 additions & 8 deletions src/app/(Authentication)/SignUp/Password/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ export default function SignUpScreen() {

return (
<View style={styles.container}>
<View style={styles.header}>
<TouchableOpacity
style={styles.backButton}
onPress={() => router.back()}
>
<Text style={styles.backText}>Back</Text>
</TouchableOpacity>
</View>
<Text style={styles.instructionText}>Next, make a password.</Text>

<View style={styles.inputBox}>
Expand Down
5 changes: 0 additions & 5 deletions src/app/(Authentication)/Welcome/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ function WelcomeScreen() {
return (
<View style={styles.container}>
<View style={styles.contentContainer}>
<Image
style={styles.image}
source={require('../../../../assets/inline-logo.jpeg')}
/>

<View style={styles.textContainer}>
<Text style={styles.welcomeText}>Welcome to the Impact Fund!</Text>
</View>
Expand Down
86 changes: 84 additions & 2 deletions src/app/(Authentication)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,88 @@
import { Stack } from 'expo-router';
import React from 'react';

export default function AuthLayout() {
return <Stack screenOptions={{ headerShown: false }} />;
import {
BackButtonNoText,
BackButtonText,
} from '../../Components/BackButtons/BackButtons';
import {
LeftAlignedHeader,
HeaderImage,
EmptyHeader,
} from '../../Components/HeaderComponents/HeaderComponents';
import { CaseContextProvider } from '../../context/CaseContext';

export default function CasesLayout() {
return (
<CaseContextProvider>
<Stack
screenOptions={{
headerShown: true,
headerBackTitleVisible: false,
headerShadowVisible: false,
}}
>
<Stack.Screen
name="Welcome/index"
options={{
headerTitle: () => <LeftAlignedHeader />,
}}
/>
<Stack.Screen
name="Login/Email/index"
options={{
headerLeft: () => <BackButtonNoText />,
headerTitle: () => <EmptyHeader />,
}}
/>
<Stack.Screen
name="Login/Password/index"
options={{
headerLeft: () => <BackButtonNoText />,
headerTitle: () => <EmptyHeader />,
}}
/>
<Stack.Screen
name="SignUp/Email/index"
options={{
headerLeft: () => <BackButtonNoText />,
headerTitle: () => <EmptyHeader />,
}}
/>
<Stack.Screen
name="SignUp/Password/index"
options={{
headerLeft: () => <BackButtonNoText />,
headerTitle: () => <EmptyHeader />,
}}
/>
<Stack.Screen
name="SignUp/Address/index"
options={{
headerTitle: () => <EmptyHeader />,
}}
/>
<Stack.Screen
name="OTPFlow/OTPEmailInput/index"
options={{
headerLeft: () => <BackButtonNoText />,
headerTitle: () => <EmptyHeader />,
}}
/>
<Stack.Screen
name="OTPFlow/OTPVerify/index"
options={{
headerLeft: () => <BackButtonNoText />,
headerTitle: () => <EmptyHeader />,
}}
/>
<Stack.Screen
name="OTPFlow/OTPNewPassword/index"
options={{
headerTitle: () => <EmptyHeader />,
}}
/>
</Stack>
</CaseContextProvider>
);
}

0 comments on commit 0e7057c

Please sign in to comment.