updating to use clerk auth with new routing to signin page by default

This commit is contained in:
Will Baumbach
2025-08-05 15:34:07 -05:00
parent 409f15f233
commit 10815a9a81
17 changed files with 1670 additions and 247 deletions

12
app/(auth)/_layout.tsx Normal file
View File

@@ -0,0 +1,12 @@
import { useAuth } from '@clerk/clerk-expo'
import { Redirect, Stack } from 'expo-router'
export default function AuthRoutesLayout() {
const { isSignedIn } = useAuth()
if (isSignedIn) {
return <Redirect href={'/'} />
}
return <Stack screenOptions={{ headerShown: false }} />
}

31
app/(auth)/sign-in.tsx Normal file
View File

@@ -0,0 +1,31 @@
import { SignIn } from '@clerk/clerk-react'
import { dark } from '@clerk/themes'
import React from 'react'
import { StyleSheet, View } from 'react-native'
export default function SignInScreen() {
return (
<View style={styles.container}>
<SignIn
appearance={{
theme: dark,
variables: {
colorPrimary: '#747b83ff',
colorBackground: '#25292e',
colorInput: '#383e46ff'
}
}}
signUpUrl='/sign-up'
/>
</View>
)
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#25292e',
padding: 5,
alignItems: 'center'
}
})

31
app/(auth)/sign-up.tsx Normal file
View File

@@ -0,0 +1,31 @@
import { SignUp } from '@clerk/clerk-expo/web'
import { dark } from '@clerk/themes'
import * as React from 'react'
import { StyleSheet, View } from 'react-native'
export default function SignUpScreen() {
return (
<View style={styles.container}>
<SignUp
appearance={{
theme: dark,
variables: {
colorPrimary: '#747b83ff',
colorBackground: '#25292e',
colorInput: '#383e46ff'
}
}}
signInUrl='/sign-in'
/>
</View>
)
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#25292e',
padding: 5,
alignItems: 'center'
}
})