-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
89 lines (80 loc) · 1.83 KB
/
App.tsx
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
import React, { useState, useEffect } from 'react';
import {
Image,
StyleSheet,
Text,
TouchableOpacity,
View
} from 'react-native';
function App(): React.JSX.Element {
let ss: number = 0;
let mm: number = 0;
let hh: number = 0;
const [botao, setBotao] = useState('Iniciar');
const [ultimo, setUltimo] = useState('00:00:00');
const [fomattedTime, setFomattedTIme] = useState('00:00:00');
const [intervalId, setIntervalId] = useState<NodeJS.Timeout | null>(null);
return (
<View style={styles.container}>
<Image
source={require('./src/assets/images/crono.png')}
/>
<Text style={styles.timer}>{fomattedTime }</Text>
<View style={styles.btnArea}>
<TouchableOpacity style={styles.btn}>
<Text style={styles.btnTexto}>{botao}</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.btn}>
<Text style={styles.btnTexto}>Limpar</Text>
</TouchableOpacity>
</View>
<View style={styles.areaTempo}>
<Text style={styles.textoCorrida}>
ULtimo tempo: 00:00:00
</Text>
</View>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#00aeef'
},
areaTempo: {
marginTop: 40,
},
textoCorrida: {
fontSize: 20,
color: '#FFF',
fontStyle: 'italic'
},
timer: {
marginTop: -160,
fontSize: 45,
fontWeight: 'bold',
color: '#FFF'
},
btn: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#FFF',
height: 40,
width: 17,
borderRadius: 20
},
btnTexto: {
fontSize: 20,
fontWeight: 'bold',
color: '#00aeef'
},
btnArea: {
flexDirection: 'row',
marginTop: 130,
height: 40
}
});
export default App;