Skip to content

Commit

Permalink
Create folders for each auth route
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapawar1 committed Nov 19, 2023
1 parent 63a41f6 commit b6f76b7
Show file tree
Hide file tree
Showing 17 changed files with 104 additions and 55 deletions.
1 change: 0 additions & 1 deletion src/app/auth/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Stack } from 'expo-router';
function StackLayout() {
return (
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen name="signup" options={{ headerShown: false }} />
<Stack.Screen name="login" options={{ headerShown: false }} />
<Stack.Screen name="onboarding" options={{ headerShown: false }} />
Expand Down
11 changes: 11 additions & 0 deletions src/app/auth/forgotPassword/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Stack } from 'expo-router';

function StackLayout() {
return (
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
</Stack>
);
}

export default StackLayout;
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import React, { useState } from 'react';
import { Alert, TextInput, View, StyleSheet } from 'react-native';
import { Button, Input } from 'react-native-elements';

import globalStyles from '../../styles/globalStyles';
import { useSession } from '../../utils/AuthContext';
import styles from './styles';
import globalStyles from '../../../styles/globalStyles';
import { useSession } from '../../../utils/AuthContext';

function ForgotPasswordScreen() {
const { updateUser, signOut, resetPassword, verifyOtp } = useSession();
Expand Down Expand Up @@ -116,13 +117,3 @@ function ForgotPasswordScreen() {
}

export default ForgotPasswordScreen;

const styles = StyleSheet.create({
input: {
height: 40,
borderColor: 'gray',
borderWidth: 1,
marginTop: 10,
padding: 5,
},
});
11 changes: 11 additions & 0 deletions src/app/auth/forgotPassword/styles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { StyleSheet } from 'react-native';

export default StyleSheet.create({
input: {
height: 40,
borderColor: 'gray',
borderWidth: 1,
marginTop: 10,
padding: 5,
},
});
21 changes: 0 additions & 21 deletions src/app/auth/index.tsx

This file was deleted.

11 changes: 11 additions & 0 deletions src/app/auth/login/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Stack } from 'expo-router';

function StackLayout() {
return (
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
</Stack>
);
}

export default StackLayout;
5 changes: 3 additions & 2 deletions src/app/auth/login.tsx → src/app/auth/login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import React, { useState } from 'react';
import { Alert, View } from 'react-native';
import { Button, Input } from 'react-native-elements';

import globalStyles from '../../styles/globalStyles';
import { useSession } from '../../utils/AuthContext';
import styles from './styles';
import globalStyles from '../../../styles/globalStyles';
import { useSession } from '../../../utils/AuthContext';

function LoginScreen() {
const sessionHandler = useSession();
Expand Down
3 changes: 3 additions & 0 deletions src/app/auth/login/styles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { StyleSheet } from 'react-native';

export default StyleSheet.create({});
11 changes: 11 additions & 0 deletions src/app/auth/onboarding/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Stack } from 'expo-router';

function StackLayout() {
return (
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
</Stack>
);
}

export default StackLayout;
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import { useState, useEffect } from 'react';
import { View, Alert, ScrollView, Platform } from 'react-native';
import { Button, Input } from 'react-native-elements';

import UserStringInput from '../../components/UserStringInput';
import globalStyles from '../../styles/globalStyles';
import { useSession } from '../../utils/AuthContext';
import supabase from '../../utils/supabase';
import styles from './styles';
import UserStringInput from '../../../components/UserStringInput';
import globalStyles from '../../../styles/globalStyles';
import { useSession } from '../../../utils/AuthContext';
import supabase from '../../../utils/supabase';

function OnboardingScreen() {
const { session } = useSession();
Expand Down
3 changes: 3 additions & 0 deletions src/app/auth/onboarding/styles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { StyleSheet } from 'react-native';

export default StyleSheet.create({});
11 changes: 11 additions & 0 deletions src/app/auth/signup/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Stack } from 'expo-router';

function StackLayout() {
return (
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
</Stack>
);
}

export default StackLayout;
5 changes: 3 additions & 2 deletions src/app/auth/signup.tsx → src/app/auth/signup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import React, { useState } from 'react';
import { Alert, View } from 'react-native';
import { Button, Input } from 'react-native-elements';

import globalStyles from '../../styles/globalStyles';
import { useSession } from '../../utils/AuthContext';
import styles from './styles';
import globalStyles from '../../../styles/globalStyles';
import { useSession } from '../../../utils/AuthContext';

function SignUpScreen() {
const { session, signUp } = useSession();
Expand Down
3 changes: 3 additions & 0 deletions src/app/auth/signup/styles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { StyleSheet } from 'react-native';

export default StyleSheet.create({});
11 changes: 11 additions & 0 deletions src/app/auth/verify/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Stack } from 'expo-router';

function StackLayout() {
return (
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
</Stack>
);
}

export default StackLayout;
17 changes: 4 additions & 13 deletions src/app/auth/verify.tsx → src/app/auth/verify/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { router } from 'expo-router';
import React, { useState } from 'react';
import { Alert, TextInput, View, StyleSheet } from 'react-native';
import { Alert, TextInput, View } from 'react-native';
import { Button } from 'react-native-elements';

import globalStyles from '../../styles/globalStyles';
import { useSession } from '../../utils/AuthContext';
import styles from './styles';
import globalStyles from '../../../styles/globalStyles';
import { useSession } from '../../../utils/AuthContext';

function VerificationScreen() {
const { user, verifyOtp, resendVerification } = useSession();
Expand Down Expand Up @@ -71,13 +72,3 @@ function VerificationScreen() {
}

export default VerificationScreen;

const styles = StyleSheet.create({
input: {
height: 40,
borderColor: 'gray',
borderWidth: 1,
marginTop: 10,
padding: 5,
},
});
11 changes: 11 additions & 0 deletions src/app/auth/verify/styles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { StyleSheet } from 'react-native';

export default StyleSheet.create({
input: {
height: 40,
borderColor: 'gray',
borderWidth: 1,
marginTop: 10,
padding: 5,
},
});

0 comments on commit b6f76b7

Please sign in to comment.