aretherecookies-mobile/js/components/IconButton.js
2018-08-12 12:18:51 -05:00

25 lines
701 B
JavaScript

// @flow
import React from 'react';
import { Text, View, TouchableOpacity } from 'react-native';
import { pure } from 'recompose';
import { Icon } from 'react-native-material-ui';
type Props = {
glyph: string,
text: string,
route: string,
onPress: Function,
color?: string,
textStyle?: Object,
};
export default pure(({ glyph, text, color = 'grey', textStyle, ...others }: Props) => (
<TouchableOpacity {...others}>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Icon name={glyph} size={28} color={color} style={{ margin: 5, marginRight: 10 }} />
<Text numberOfLines={2} ellipsizeMode="tail" style={textStyle}>
{text}
</Text>
</View>
</TouchableOpacity>
));