-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #443 from icssc/dx-improvements
Dx improvements
- Loading branch information
Showing
43 changed files
with
8,837 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
DATABASE_URL="postgres://admin:admin@localhost:5434/zotmeal" | ||
DATABASE_URL="postgres://admin:admin@localhost:5433/zotmeal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
import * as React from "react"; | ||
import { SafeAreaView } from "react-native"; | ||
import { SignedIn, SignedOut, useAuth } from "@clerk/clerk-expo"; | ||
import { Text } from "tamagui"; | ||
|
||
export default function Auth() { | ||
return <Text>Auth</Text>; | ||
import SignInWithOAuth from "~/components/auth/SignInWithOAuth"; | ||
|
||
export default function AuthPage() { | ||
const auth = useAuth(); | ||
console.log("is signed in", auth.isSignedIn); | ||
return ( | ||
<SafeAreaView> | ||
<SignedIn> | ||
<Text>You are Signed in</Text> | ||
</SignedIn> | ||
<SignedOut> | ||
<SignInWithOAuth /> | ||
</SignedOut> | ||
</SafeAreaView> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ export default function EventsLayout() { | |
</Stack> | ||
</EventsProvider> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from "react"; | ||
import { Button } from "react-native"; | ||
import * as WebBrowser from "expo-web-browser"; | ||
import { useOAuth } from "@clerk/clerk-expo"; | ||
|
||
import { useWarmUpBrowser } from "~/hooks/useWarmUpBrowser"; | ||
|
||
WebBrowser.maybeCompleteAuthSession(); | ||
|
||
const SignInWithOAuth = () => { | ||
// Warm up the android browser to improve UX | ||
// https://docs.expo.dev/guides/authentication/#improving-user-experience | ||
useWarmUpBrowser(); | ||
|
||
const { startOAuthFlow } = useOAuth({ strategy: "oauth_google" }); | ||
|
||
const onPress = React.useCallback(async () => { | ||
try { | ||
const { createdSessionId, signIn, signUp, setActive } = | ||
await startOAuthFlow(); | ||
|
||
if (createdSessionId && setActive) { | ||
await setActive({ session: createdSessionId }); // Await the setActive function call | ||
} else { | ||
// Use signIn or signUp for next steps such as MFA | ||
} | ||
} catch (err) { | ||
console.error("OAuth error", err); | ||
} | ||
}, []); | ||
|
||
return <Button title="Sign in with Google" onPress={onPress} />; | ||
}; | ||
export default SignInWithOAuth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import HamburgerMenu from "./HamburgerMenu"; | ||
import Logo from "./Logo"; | ||
import PinButton from "./PinButton"; | ||
import RestaurantTabs from "./RestaurantTabs"; | ||
|
||
export { HamburgerMenu, Logo, PinButton, RestaurantTabs }; | ||
export * from "./navigation/HamburgerMenu"; | ||
export * from "./Logo"; | ||
export * from "./PinButton"; | ||
export * from "./navigation/RestaurantTabs"; |
Oops, something went wrong.