Skip to content

Commit

Permalink
Updated provider, dependencies, layout, and modals
Browse files Browse the repository at this point in the history
  • Loading branch information
flemingvincent committed Sep 30, 2024
1 parent 1d487b7 commit 239e35f
Show file tree
Hide file tree
Showing 6 changed files with 298 additions and 448 deletions.
20 changes: 18 additions & 2 deletions app/(app)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,30 @@ export default function AppLayout() {
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="(protected)" />
<Stack.Screen name="welcome" />
<Stack.Screen name="sign-up" options={{ presentation: "modal" }} />
<Stack.Screen
name="sign-up"
options={{
presentation: "modal",
headerShown: true,
headerTitle: "Sign Up",
}}
/>
<Stack.Screen
name="sign-in"
options={{
presentation: "modal",
headerShown: true,
headerTitle: "Sign In",
}}
/>
<Stack.Screen
name="modal"
options={{
presentation: "modal",
headerShown: true,
headerTitle: "Modal",
}}
/>
<Stack.Screen name="modal" options={{ presentation: "modal" }} />
</Stack>
);
}
2 changes: 1 addition & 1 deletion app/(app)/sign-in.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function SignIn() {
}

return (
<SafeAreaView className="flex-1 bg-background p-4">
<SafeAreaView className="flex-1 bg-background p-4" edges={["bottom"]}>
<View className="flex-1 gap-4 web:m-4">
<H1 className="self-start ">Sign In</H1>
<Form {...form}>
Expand Down
2 changes: 1 addition & 1 deletion app/(app)/sign-up.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function SignUp() {
}

return (
<SafeAreaView className="flex-1 bg-background p-4">
<SafeAreaView className="flex-1 bg-background p-4" edges={["bottom"]}>
<View className="flex-1 gap-4 web:m-4">
<H1 className="self-start">Sign Up</H1>

Expand Down
10 changes: 6 additions & 4 deletions context/supabase-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ export const SupabaseProvider = ({ children }: SupabaseProviderProps) => {
};

useEffect(() => {
const { data } = supabase.auth.onAuthStateChange(async (event, session) => {
supabase.auth.getSession().then(({ data: { session } }) => {
setSession(session);
setUser(session ? session.user : null);
setInitialized(true);
});
return () => {
data.subscription.unsubscribe();
};

supabase.auth.onAuthStateChange((_event, session) => {
setSession(session);
setUser(session ? session.user : null);
});
}, []);

useEffect(() => {
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
},
"dependencies": {
"@hookform/resolvers": "^3.1.1",
"@react-native-async-storage/async-storage": "2.0.0",
"@react-native-async-storage/async-storage": "1.23.1",
"@supabase/supabase-js": "^2.45.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"expo": "~51.0.34",
"expo": "~51.0.35",
"expo-constants": "~16.0.2",
"expo-image": "~1.13.0",
"expo-linking": "~6.3.1",
Expand All @@ -24,14 +24,14 @@
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.7",
"nativewind": "^4.0.1",
"react": "18.3.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.45.0",
"react-native": "0.75.3",
"react-native-gesture-handler": "~2.20.0",
"react-native-reanimated": "~3.15.3",
"react-native-safe-area-context": "4.11.0",
"react-native-screens": "3.34.0",
"react-native": "0.74.5",
"react-native-gesture-handler": "~2.16.1",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-url-polyfill": "^2.0.0",
"react-native-web": "^0.19.12",
"tailwind-merge": "^2.2.1",
Expand All @@ -40,11 +40,11 @@
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/react": "~18.3.10",
"@types/react": "~18.2.79",
"eslint": "^8.57.1",
"eslint-config-universe": "^13.0.0",
"prettier": "^3.0.3",
"typescript": "~5.6.2"
"typescript": "~5.3.3"
},
"private": true
}
Loading

0 comments on commit 239e35f

Please sign in to comment.