-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
101 lines (88 loc) · 2.64 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import React, {useState} from 'react';
import { StyleSheet, Text, SafeAreaView, View, TouchableOpacity, Image, TextInput, KeyboardAvoidingView} from 'react-native';
import * as screen from "./src/constants/dimensions"
export default function App() {
const [userName, setUserName] = useState("");
return (
<SafeAreaView style={styles.container}>
<View style={styles.header}>
<Image
source={require('./assets/Imagens/covidTitle.png')}
style = {styles.titleImage}
resizeMode={"contain"}
/>
</View>
<View>
<Image source={require("./assets/Imagens/corona-doctor.gif")}
style={styles.gifImage}
resizeMode={"cover"}
/>
</View>
<KeyboardAvoidingView behavior={"position"}>
<TextInput style={styles.userNameInput}
placeholder={"@USUARIO"}
autoCapitalize={"none"}
autoCorrect={false}
value={userName}
onChangeText={(newText)=> setUserName(newText)}
/>
</KeyboardAvoidingView>
<TouchableOpacity style={styles.submitButton} onPress={() => console.log('clicked')}>
<Text> ENTRAR </Text>
</TouchableOpacity>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
header:{
alignItems: "flex-end",
marginTop: screen.height * 0.05
},
titleImage: {
width: screen.width * 0.8,
height: screen.height * 0.2,
marginRight: screen.width * 0.04,
},
gifImage:{
width: screen.width * 1,
height: screen.height * 0.45,
},
userNameInput:{
borderWidth: 1,
width: screen.width * 0.9,
height: screen.height * 0.05,
alignSelf: "center",
backgroundColor: '#f5f5f5',
borderRadius: screen.width * 0.02,
color: "#333",
paddingHorizontal: screen.width * 0.03,
},
submitButton:{
width: screen.width * 0.2,
height: screen.height * 0.06,
backgroundColor: '#75ffaf',
alignSelf: "center",
borderRadius: screen.width * 0.02,
marginTop: 10,
alignItems: "center",
justifyContent: "center",
}
});
// export default function App() {
// //let count = 0; //assim o count nao vai mudar pq a aplicacao nao vai atualizar, precisamos fazer ele como um state
// const [state, setState] = useState(0)
// return (
// <SafeAreaView style={styles.container}>
// <Text>
// {state}
// </Text>
// <Button title="aumentar" onPress={()=>setState(state + 1)}/>
// </SafeAreaView>
// );
// }
//propriedades ex de prop na view é o style.
//estados == states
//usar sempre camelcase, mesmo no flexbox