-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtodo.js
54 lines (53 loc) · 1.19 KB
/
todo.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
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
TouchableOpacity,
} from 'react-native';
export default class Todo extends Component {
render() {
return (
<View key={this.props.keyval} style={styles.note}>
<Text style={styles.noteText} >{this.props.val.date}</Text>
<Text style={styles.noteText} >{this.props.val.note}</Text>
<TouchableOpacity onPress={this.props.deleteMethod} style={styles.noteDelete} >
<Text style={styles.noteDeleteText} >D</Text>
</TouchableOpacity>
</View>
);
}
}
const styles = StyleSheet.create({
note: {
position:'relative',
padding:20,
paddingRight:100,
borderBottomWidth:2,
borderBottomColor:'#ededed',
},
noteText:{
paddingLeft:20,
borderLeftWidth:10,
borderLeftColor:'#E91E63',
},
noteDelete:{
position:'absolute',
justifyContent:'center',
alignItems:'center',
backgroundColor:'#2980b9',
padding:10,
top:10,
bottom:10,
right:10,
},
noteDeleteText:{
color:'#fff',
}
});