Created
March 7, 2017 17:52
-
-
Save isbaek/1f7b73a82063e8831bdde5f37f16c57d to your computer and use it in GitHub Desktop.
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
function EventTypeIcon(props) { | |
var bgColor = props.color; | |
var textColor = "#fff"; | |
if(props.inverted) { | |
bgColor = "#fff"; | |
textColor = props.color; | |
} | |
return <Icon.Button | |
{...props} | |
name={props.icon} | |
color={bgColor} | |
iconStyle={[styles.EventTypeIcon, {backgroundColor: bgColor, color: textColor}]} | |
backgroundColor={textColor} | |
borderRadius={50}><Text style={styles.iconText}>{props.text}</Text></Icon.Button>; | |
} | |
const styles = EStyleSheet.create({ | |
'@media (max-width: 350)': { | |
EventTypeIcon: { | |
backgroundColor: "#fff", | |
color: "#333", | |
borderRadius: 15, | |
padding: '0.5rem', | |
fontSize: '0.75rem', | |
width: '1.7rem', | |
height: '1.7rem', | |
textAlign: "center", | |
overflow: 'hidden', | |
}, | |
iconText: { | |
fontSize: '0.75rem', | |
color: textColor, | |
} | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment