Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created February 18, 2019 12:57
Show Gist options
  • Save amandeepmittal/56aedbaf3117ef55aeed0d1c044895f7 to your computer and use it in GitHub Desktop.
Save amandeepmittal/56aedbaf3117ef55aeed0d1c044895f7 to your computer and use it in GitHub Desktop.
import React from 'react';
import { StyleSheet, TouchableOpacity, View, Text } from 'react-native';
import Icon from 'react-native-vector-icons/Feather';
export default function TodoList(props) {
return (
<View style={styles.listContainer}>
<Icon name="square" size={30} color="black" style={{ marginLeft: 15 }} />
<Text style={styles.listItem}>{props.text}</Text>
<Icon
name="trash-2"
size={30}
color="red"
style={{ marginLeft: 'auto' }}
onPress={props.deleteTodo}
/>
</View>
);
}
const styles = StyleSheet.create({
listContainer: {
marginTop: '5%',
flexDirection: 'row',
borderColor: '#aaaaaa',
borderBottomWidth: 1.5,
width: '100%',
alignItems: 'stretch',
minHeight: 40
},
listItem: {
paddingBottom: 20,
paddingLeft: 10,
marginTop: 6,
borderColor: 'green',
borderBottomWidth: 1,
fontSize: 17,
fontWeight: 'bold',
color: 'white'
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment