-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Material icons in entry details for Android and Improve layout on iOS
- Loading branch information
Showing
3 changed files
with
197 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import React, { Component } from 'react' | ||
import { StyleSheet, View, Text } from 'react-native' | ||
import MaterialIcon from 'react-native-vector-icons/MaterialIcons' | ||
|
||
class MnmEntradaInfo extends Component { | ||
render() { | ||
const e = this.props.entry; | ||
return ( | ||
<View style={styles.container}> | ||
<View style={styles.leftContainer}> | ||
<View style={styles.dataContainer}> | ||
<MaterialIcon style={[styles.icon, styles.upArrow]} name="arrow-upward" size={iconSize} /> | ||
<Text style={[styles.iconText, styles.meneos]}>{e.votes} meneos</Text> | ||
</View> | ||
<View style={styles.dataContainer}> | ||
<MaterialIcon style={styles.icon} name="arrow-downward" size={iconSize} /> | ||
<Text style={styles.iconText}>{e.negatives} negativos</Text> | ||
</View> | ||
<View style={styles.dataContainer}> | ||
<MaterialIcon style={styles.icon} name="favorite" size={iconSize} /> | ||
<Text style={styles.iconText}>{e.karma} karma</Text> | ||
</View> | ||
<View style={styles.dataContainer}> | ||
<MaterialIcon style={styles.icon} name="comment" size={iconSize} /> | ||
<Text style={styles.iconText}>{e.comments} comentarios</Text> | ||
</View> | ||
<View style={styles.dataContainer}> | ||
<MaterialIcon style={styles.icon} name="local-offer" size={iconSize} /> | ||
<Text style={styles.iconText}>{e.tags}</Text> | ||
</View> | ||
</View> | ||
<View style={styles.rightContainer}> | ||
<MaterialIcon style={styles.userIcon} name="account-circle" size={40} /> | ||
<Text style={styles.username}>{e.user}</Text> | ||
</View> | ||
</View> | ||
) | ||
} | ||
} | ||
|
||
const iconSize = 24 | ||
const mnmColor = '#d35400' | ||
const detailColor = '#95a5a6' | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
marginLeft: 20, | ||
marginRight: 20, | ||
marginTop: 20, | ||
flexDirection: 'row', | ||
}, | ||
leftContainer: { | ||
flex: 1, | ||
flexDirection: 'column', | ||
marginBottom: 15, | ||
}, | ||
rightContainer: { | ||
flex: 1, | ||
}, | ||
dataContainer: { | ||
flex: 1, | ||
flexDirection: 'row', | ||
alignItems: 'flex-start', | ||
marginBottom: 5, | ||
}, | ||
icon: { | ||
width: 28, | ||
marginRight: 5, | ||
color: detailColor, | ||
}, | ||
upArrow: { | ||
color: mnmColor, | ||
}, | ||
iconText: { | ||
flex: 1, | ||
fontSize: 14, | ||
fontWeight: '300', | ||
color: detailColor, | ||
}, | ||
meneos: { | ||
color: mnmColor, | ||
}, | ||
userIcon: { | ||
marginBottom: 4, | ||
color: detailColor, | ||
textAlign: 'center', | ||
}, | ||
username: { | ||
fontWeight: 'bold', | ||
fontSize: 14, | ||
textAlign: 'center', | ||
}, | ||
}) | ||
|
||
module.exports = MnmEntradaInfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import React, { Component } from 'react' | ||
import { StyleSheet, View, Text } from 'react-native' | ||
|
||
import IonIcon from 'react-native-vector-icons/Ionicons' | ||
import EvilIcon from 'react-native-vector-icons/EvilIcons' | ||
|
||
class MnmEntradaInfo extends Component { | ||
|
||
render() { | ||
const e = this.props.entry; | ||
return ( | ||
<View style={styles.container}> | ||
<View style={styles.leftContainer}> | ||
<View style={styles.dataContainer}> | ||
<IonIcon style={[styles.icon, styles.ionicIcon, styles.upArrow]} name="ios-arrow-round-up" size={iconSize} /> | ||
<Text style={[styles.iconText, styles.meneos]}>{e.votes} meneos</Text> | ||
</View> | ||
<View style={styles.dataContainer}> | ||
<IonIcon style={[styles.icon, styles.ionicIcon]} name="ios-arrow-round-down" size={iconSize} /> | ||
<Text style={styles.iconText}>{e.negatives} negativos</Text> | ||
</View> | ||
<View style={styles.dataContainer}> | ||
<EvilIcon style={styles.icon} name="heart" size={iconSize} /> | ||
<Text style={styles.iconText}>{e.karma} karma</Text> | ||
</View> | ||
<View style={styles.dataContainer}> | ||
<EvilIcon style={styles.icon} name="comment" size={iconSize} /> | ||
<Text style={styles.iconText}>{e.comments} comentarios</Text> | ||
</View> | ||
<View style={styles.dataContainer}> | ||
<EvilIcon style={styles.icon} name="tag" size={iconSize} /> | ||
<Text style={styles.iconText}>{e.tags}</Text> | ||
</View> | ||
</View> | ||
<View style={styles.rightContainer}> | ||
<EvilIcon style={styles.userIcon} name="user" size={50} /> | ||
<Text style={styles.username}>{e.user}</Text> | ||
</View> | ||
</View> | ||
) | ||
} | ||
} | ||
|
||
const iconSize = 30 | ||
const mnmColor = '#d35400' | ||
const detailColor = '#95a5a6' | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
marginLeft: 10, | ||
marginRight: 10, | ||
marginTop: 20, | ||
flexDirection: 'row', | ||
}, | ||
leftContainer: { | ||
flex: 1, | ||
flexDirection: 'column', | ||
marginBottom: 15, | ||
}, | ||
rightContainer: { | ||
flex: 1, | ||
}, | ||
dataContainer: { | ||
flex: 1, | ||
flexDirection: 'row', | ||
alignItems: 'flex-start', | ||
}, | ||
icon: { | ||
width: 28, | ||
marginRight: 5, | ||
color: detailColor, | ||
}, | ||
ionicIcon: { | ||
paddingLeft: 10, | ||
}, | ||
upArrow: { | ||
color: mnmColor, | ||
}, | ||
iconText: { | ||
flex: 1, | ||
fontSize: 14, | ||
fontWeight: '300', | ||
color: detailColor, | ||
}, | ||
meneos: { | ||
color: mnmColor, | ||
}, | ||
userIcon: { | ||
marginBottom: 4, | ||
color: detailColor, | ||
textAlign: 'center', | ||
}, | ||
username: { | ||
fontWeight: 'bold', | ||
fontSize: 14, | ||
textAlign: 'center', | ||
}, | ||
}) | ||
|
||
module.exports = MnmEntradaInfo |
This file was deleted.
Oops, something went wrong.