-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
64 lines (55 loc) · 1.66 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
import React from 'react';
import { View, StyleSheet, Text } from 'react-native';
import Routes from './src/routes';
// import { NotesContext } from './src/context';
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import { Provider } from 'react-redux';
import reducers from './src/reducers';
let store = createStore(reducers, applyMiddleware(thunk));
class App extends React.Component {
// constructor(props) {
// super(props);
// let notes = [{ id: String(Date.now()+Math.random()), title: 'A', text: 'hola soy bata', date: new Date().toLocaleString() }, { id: String(Date.now()+Math.random()), title: 'B', Text: 'Hola soy Batman', date: new Date().toLocaleString() }]
// this.state = {
// notes: notes,
// addNote: this.addNote,
// deleteNote: this.deleteNote,
// }
// }
// addNote = (note) => {
// this.setState({
// notes: [...this.state.notes, { id: String(Date.now()+Math.random())}]
// });
// }
// deleteNote = (id) => {
// this.setState({
// notes: this.state.notes.filter(note => note.id !== id)
// });
// }
// editNote = (id,key,value) => {
// this.setState({
// notes: this.state.notes.map(note => {
// if(note.id === id) {
// console.log('change')
// }
// }),
// })
// }
render() {
return (
<Provider store={store}>
<Routes />
</Provider>
);
}
}
/* <NotesContext.Provider value={this.state}> */
/* </NotesContext.Provider> */
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#ffff',
},
});
export default App