diff --git a/examples/todo-expo/App.tsx b/examples/todo-expo/App.tsx index 590dd11288b..dea88ca9ea5 100644 --- a/examples/todo-expo/App.tsx +++ b/examples/todo-expo/App.tsx @@ -1,73 +1,30 @@ import React from 'react' -import AsyncStorage from '@react-native-community/async-storage' -import { createClient } from '@supabase/supabase-js' import { StatusBar } from 'expo-status-bar' -import { Alert, StyleSheet, Text, View } from 'react-native' -import { Styles, SUPABASE_URL, SUPABASE_ANON_KEY } from './lib/constants' +import { StyleSheet, View, Platform } from 'react-native' +import { ThemeProvider, colors, Text } from 'react-native-elements' +import { Styles } from './lib/constants' +import Auth from './components/Auth' -import Button from './components/Button' -import TextField from './components/TextField' - -const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, { - localStorage: AsyncStorage as any, -}) +const theme = { + colors: { + ...Platform.select({ + default: colors.platform.android, + ios: colors.platform.ios, + }), + }, +} export default function App() { - const [email, setEmail] = React.useState('') - const [password, setPassword] = React.useState('') - - const handleLogin = async (type: string, email: string, password: string) => { - - // console.log('email', email) - // console.log('password', password) - try { - const { error, user } = - type === 'LOGIN' - ? await supabase.auth.signIn({ email, password }) - : await supabase.auth.signUp({ email, password }) - if (!error && !user) Alert.alert('Check your email for the login link!') - if (error) Alert.alert(error.message) - console.log('user', user) - console.log('error', error) - } catch (error) { - console.log('Error thrown:', error.message) - Alert.alert(error.error_description || error) - } - } - return ( - - - To Do List + + + + Todo List + + + - - Email - setEmail(text)} - text={email} - placeholder="Enter your email" - autoCapitalize={'none'} - /> - - - Password - setPassword(text)} - text={password} - type={'password'} - placeholder="Enter your password" - customStyles={{ textTransform: 'lowercase' }} - autoCapitalize={'none'} - /> - - -