-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
70 lines (59 loc) · 1.99 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
import React, {Component} from 'react';
import { StyleSheet, Text, View, FlatList } from 'react-native';
import * as Font from 'expo-font';
import commonStyles from './src/commonStyles'
import Task from './src/components/Task'
export default class App extends Component{
state = {
fontLoaded: false,
tasks: [
{id: Math.random(), desc: 'Compra curso de react native',
estimateAt: new Date(), doneAt: new Date() },
{id: Math.random(), desc: 'Concluir o Curso',
estimateAt: new Date(), doneAt: null},
{id: Math.random(), desc: 'Compra curso de react native',
estimateAt: new Date(), doneAt: new Date() },
{id: Math.random(), desc: 'Concluir o Curso',
estimateAt: new Date(), doneAt: null},
{id: Math.random(), desc: 'Compra curso de react native',
estimateAt: new Date(), doneAt: new Date() },
{id: Math.random(), desc: 'Concluir o Curso',
estimateAt: new Date(), doneAt: null},
{id: Math.random(), desc: 'Compra curso de react native',
estimateAt: new Date(), doneAt: new Date() },
{id: Math.random(), desc: 'Concluir o Curso',
estimateAt: new Date(), doneAt: null},
]
};
async componentDidMount() {
await Font.loadAsync({
'outwrite': require('./assets/fonts/Outwrite.ttf'),
'lato': require('./assets/fonts/Lato.ttf'),
});
this.setState({ fontLoaded: true });
}
render(){
return (
<View style={styles.container}>
{this.state.fontLoaded ? (
// <Text style={styles.texto}>Janailton Galvão Pereira!</Text>
<FlatList data={this.state.tasks}
keyExtractor={item => `${item.id}`}
renderItem={({ item }) => <Task {...item}/>} />
):null}
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
texto:{
fontFamily: commonStyles.fontFamily,
fontSize:15,
}
});