West Ace
West Ace

Reputation: 1

( onPress) TouchableOpacity not working(nothing appears)

I click the Touchable and ABSOLUTYLY nothing appears on screen, nothing... I hope that al least a error appear, but litteraly nothing happens when I click the TouchbleOpacity. Im stuck in this error for 2 days... Im dyingggg

My code:

const auth = getAuth();

const SignUpScreen: React.FC<StackScreenProps<any>> = ({ navigation }) => {

    const [value, setValue] = React.useState({
        email: '',
        password: '',
        error: ''
      })
    
      async function signUp() {
        if (value.email === '' || value.password === '') {
            setValue({
              ...value,
              error: 'Email and password are mandatory.'
            })
            return;
          }
        
          try {
            await createUserWithEmailAndPassword(auth, value.email, value.password);
            navigation.navigate('Sign In');
          } catch (error) {
            setValue({
              ...value,
              error: error.message,
            })
          }
      }

    return (
        <View style={styles.mainView}>  
            <View style={styles.TopView}>
                <Image style={styles.ImageStyle}source={require('../assets/logo.png')}  ></Image>
            </View>

            <ScrollView style={styles.BottomView}>
                <Text style={styles.Heading}>
                    Primeira vez{'\n'}
                    por aqui?👋
                </Text>

            <View style={styles.FormView}>

                <TextInput onChangeText={(text) => setValue({ ...value, email: text })} placeholder={"Não te enganes no email👮‍♂️"} placeholderTextColor={"#fff"} style={styles.TextInput} />
                <TextInput onChangeText={(text) => setValue({ ...value, password: text })} placeholder={"Password JÁ🤫"} secureTextEntry={true} placeholderTextColor={"#fff"} style={styles.TextInput} />
                    <TouchableOpacity style={styles.Button} onPress={signUp}>
                            <Text style={styles.ButtonText}>Regista-te</Text>
                        </TouchableOpacity>
                    </View>

                    <TouchableOpacity style={styles.TextButton} onPress={() => navigation.navigate('Sign In')}>
                <Text style={styles.SignUpText}>
                    Já tens uma conta?
                </Text>
                </TouchableOpacity>
            </ScrollView>

    </View>
    )
}

Upvotes: 0

Views: 55

Answers (0)

Related Questions