-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
56 lines (49 loc) · 1.33 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
import React from 'react';
import {
StyleSheet,
View,
Image,
Text,
TouchableOpacity,
Alert,
} from 'react-native';
import logo from './imgs/logo.png';
const App = () => {
function getPhrase() {
const random_number = Math.floor(Math.random() * 5);
const phrases = [];
phrases.push('O senhor é meu pastor e nada me faltará');
phrases.push('Aquele que habita no esconderijo do altíssimo, à sombra do onipotente descansará.');
phrases.push('O ser humano pode fazer muitos planos; contudo, quem decide é Deus, o SENHOR.');
phrases.push('Pois Tu tens sido o meu refúgio, uma fortaleza diante do meu inimigo.');
phrases.push('Abres tua mão e sacias, de bom grado, todo ser vivo.');
Alert.alert(phrases[random_number]);
}
return (
<View style={styles.container}>
<Image source={logo} />
<TouchableOpacity onPress={getPhrase} style={styles.button}>
<Text style={styles.label}>Nova frase</Text>
</TouchableOpacity>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
button: {
backgroundColor: '#538530',
paddingVertical: 10,
paddingHorizontal: 40,
marginTop: 20,
},
label: {
color: '#fff',
fontSize: 16,
fontWeight: 'bold',
},
});
export default App;