Skip to content

Commit

Permalink
Update import paths and fix formatting in sign-in
Browse files Browse the repository at this point in the history
and sign-up screens
  • Loading branch information
Timothy Miller committed Nov 5, 2023
1 parent 3b0b216 commit f262402
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 55 deletions.
12 changes: 4 additions & 8 deletions packages/app/features/sign-in/screen.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import { YStack, useToastController } from '@t4/ui'
import { SignUpSignInComponent } from 'app/features/sign-in/SignUpSignIn'
import { useRouter } from 'solito/router'
import type { Provider } from '@supabase/supabase-js'
import Constants from 'expo-constants'
import { capitalizeWord } from 'app/utils/string'
import { isExpoGo } from 'app/utils/flags'
import { useSupabase } from 'app/utils/supabase/hooks/useSupabase'
import * as WebBrowser from 'expo-web-browser'
import { getInitialURL } from 'expo-linking'
import { Platform } from 'react-native'
import { initiateAppleSignIn } from 'app/utils/supabase/appleAuth'
import { capitalizeWord } from '@t4/ui/src/libs/string'

export const SignInScreen = (): React.ReactNode => {
const { replace } = useRouter()
Expand Down Expand Up @@ -67,11 +65,9 @@ export const SignInScreen = (): React.ReactNode => {
supabase.auth._notifyAllSubscribers('SIGNED_IN', session)
replace('/')
} else {
if (!isExpoGo) {
toast.show(capitalizeWord(provider) + ' sign in failed', {
description: error?.message || 'Something went wrong, please try again.',
})
}
toast.show(capitalizeWord(provider) + ' sign in failed', {
description: error?.message || 'Something went wrong, please try again.',
})
console.log('Supabase session error:', error)
}
})
Expand Down
11 changes: 4 additions & 7 deletions packages/app/features/sign-in/screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { YStack, useToastController } from '@t4/ui'
import { SignUpSignInComponent } from 'app/features/sign-in/SignUpSignIn'
import { useRouter } from 'solito/router'
import type { Provider } from '@supabase/supabase-js'
import { capitalizeWord } from 'app/utils/string'
import { isExpoGo } from 'app/utils/flags'
import { useSupabase } from 'app/utils/supabase/hooks/useSupabase'
import { capitalizeWord } from '@t4/ui/src/libs/string'

export const SignInScreen = (): React.ReactNode => {
const { replace } = useRouter()
Expand All @@ -23,11 +22,9 @@ export const SignInScreen = (): React.ReactNode => {
})

if (error) {
if (!isExpoGo) {
toast.show(capitalizeWord(provider) + ' sign in failed', {
description: error.message,
})
}
toast.show(capitalizeWord(provider) + ' sign in failed', {
description: error.message,
})
console.log('OAuth Sign in failed', error)
return
}
Expand Down
29 changes: 11 additions & 18 deletions packages/app/features/sign-up/screen.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import { YStack, useToastController } from '@t4/ui'
import { useRouter } from 'solito/router'
import { SignUpSignInComponent } from 'app/features/sign-in/SignUpSignIn'
import type { Provider } from '@supabase/supabase-js'
import { capitalizeWord } from 'app/utils/string'
import { isExpoGo } from 'app/utils/flags'
import { useSupabase } from 'app/utils/supabase/hooks/useSupabase'
import * as WebBrowser from 'expo-web-browser'
import { getInitialURL } from 'expo-linking'
import { Platform } from 'react-native'
import { initiateAppleSignIn } from 'app/utils/supabase/appleAuth'
import { capitalizeWord } from '@t4/ui/src/libs/string'

export const SignUpScreen = (): React.ReactNode => {
const { replace } = useRouter()
Expand Down Expand Up @@ -67,11 +66,9 @@ export const SignUpScreen = (): React.ReactNode => {
supabase.auth._notifyAllSubscribers('SIGNED_IN', session)
replace('/')
} else {
if (!isExpoGo) {
toast.show(capitalizeWord(provider) + ' sign in failed', {
description: error?.message || 'Something went wrong, please try again.',
})
}
toast.show(capitalizeWord(provider) + ' sign in failed', {
description: error?.message || 'Something went wrong, please try again.',
})
console.log('Supabase session error:', error)
}
})
Expand Down Expand Up @@ -101,18 +98,14 @@ export const SignUpScreen = (): React.ReactNode => {
password,
})
if (error) {
if (!isExpoGo) {
console.log('error', error)
toast.show('Sign up failed', {
message: error.message,
})
}
console.log('error', error)
toast.show('Sign up failed', {
message: error.message,
})
} else if (data?.user) {
if (!isExpoGo) {
toast.show('Email Confirmation', {
message: 'Check your email ',
})
}
toast.show('Email Confirmation', {
message: 'Check your email ',
})
replace('/')
}
}
Expand Down
29 changes: 11 additions & 18 deletions packages/app/features/sign-up/screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { YStack, useToastController } from '@t4/ui'
import { useRouter } from 'solito/router'
import { SignUpSignInComponent } from 'app/features/sign-in/SignUpSignIn'
import type { Provider } from '@supabase/supabase-js'
import { capitalizeWord } from 'app/utils/string'
import { isExpoGo } from 'app/utils/flags'
import { useSupabase } from 'app/utils/supabase/hooks/useSupabase'
import { capitalizeWord } from '@t4/ui/src/libs/string'

export const SignUpScreen = (): React.ReactNode => {
const { push } = useRouter()
Expand All @@ -25,11 +24,9 @@ export const SignUpScreen = (): React.ReactNode => {
: {},
})
if (error) {
if (!isExpoGo) {
toast.show(capitalizeWord(provider) + ' sign up failed', {
description: error.message,
})
}
toast.show(capitalizeWord(provider) + ' sign up failed', {
description: error.message,
})
return
}
push('/')
Expand All @@ -41,18 +38,14 @@ export const SignUpScreen = (): React.ReactNode => {
password,
})
if (error) {
if (!isExpoGo) {
console.log('error', error)
toast.show('Sign up failed', {
message: error.message,
})
}
console.log('error', error)
toast.show('Sign up failed', {
message: error.message,
})
} else if (data?.user) {
if (!isExpoGo) {
toast.show('Email Confirmation', {
message: 'Check your email ',
})
}
toast.show('Email Confirmation', {
message: 'Check your email ',
})
push('/')
}
}
Expand Down
3 changes: 0 additions & 3 deletions packages/app/utils/flags.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/ui/src/cars/CarListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { formatNumber, formatPrice } from 'app/utils/number'
import { formatNumber, formatPrice } from '@t4/ui/src/libs/number'
import type { Car } from '@t4/api/src/db/schema'
import { SolitoImage } from 'solito/image'
import { Paragraph, YStack } from 'tamagui'
Expand Down
File renamed without changes.
File renamed without changes.

1 comment on commit f262402

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔ EAS production build completed

  • 🤖 Android build failed ❌
  • 🍏 IOS build failed ❌
Android QR IOS QR

Please sign in to comment.