-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
65 lines (60 loc) · 2.07 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// import React from "react";
// import { Text, View, SafeAreaView, TextInput } from "react-native";
// import Button from "./src/utility/Button";
//
// const Home = () => {
// return (
// <SafeAreaView style={{ backgroundColor: "red", flex: 1, justifyContent: "space-between", flexDirection: "row" }}>
// <View style={{ backgroundColor: "green",opacity:0.2 }}>
// <Text>adadadadada</Text>
// </View>
// <View style={{ backgroundColor: "gray",opacity:0.4 }}>
// <Text>adadadadada</Text>
// <TextInput
// placeholder={"Hello"}
// inlineImageLeft='search_icon'
// />
// </View>
//
// </SafeAreaView>
// );
// };
// export default Home;
//This is an example code to show Image Icon in TextInput//
import React, { useContext, useState } from "react";
import { ScrollView, StyleSheet, View } from "react-native";
import Button from "./src/utility/Button";
import EditText from "./src/utility/EditText";
import { AuthContext, AuthProvider } from "./src/navigation/AuthProvider";
import auth from "@react-native-firebase/auth";
const App = () => {
const [email,setEmail]=useState("");
const [password,setPassword]=useState("");
const register = async (email,password)=>{
try {
// await auth().createUserWithEmailAndPassword(email,password);
await auth().signInWithEmailAndPassword(email,password);
await alert('success')
}catch (e) {
console.log(e);
}
}
return (
<AuthProvider>
<View style={styles.container}>
<EditText ImageSource={require("./img.png")} PlaceHolder={"Enter Email"} image={true} onChange={(text)=>{setEmail(text)}}/>
<EditText PlaceHolder={"Enter Password"} onChange={(text1)=>{setPassword(text1)}}/>
<Button Press={()=>{register(email, password)}} text={"Submit"}/>
<Button Press={()=>{alert(JSON.stringify(auth.EmailAuthProvider}} text={"Submit"}/>
</View>
</AuthProvider>
);
};
export default App;
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
backgroundColor: "green"
},
});