aretherecookies-mobile/js/components/IconButton.js
2017-07-23 19:58:10 -05:00

18 lines
611 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 };
export default pure(({ glyph, text, color = 'grey', ...others }: Props) =>
<TouchableOpacity {...others}>
<View style={{ flexDirection: 'row', marginTop: 5 }}>
<Icon name={glyph} size={35} color={color} style={{ marginRight: 10 }} />
<Text style={{ lineHeight: 26 }}>
{text}
</Text>
</View>
</TouchableOpacity>
);