aretherecookies-mobile/js/components/PickerItemRow.js
2020-01-19 22:59:57 -06:00

28 lines
821 B
JavaScript

import React from 'react';
import { TouchableOpacity, Text } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import { Divider } from 'react-native-material-ui';
import theme from '../ui-theme';
const { pickerItemRow: style } = theme;
const pickerItemRowContainerStyle = {
padding: 20,
flexDirection: 'row',
justifyContent: 'space-between',
};
const PickerItemRow = ({ isSelected, onPress, text = { text } }) => {
const color = isSelected ? style.selectedColor : style.defaultColor;
return (
<>
<TouchableOpacity onPress={onPress} style={pickerItemRowContainerStyle}>
<Text style={{ color, fontSize: 16 }}>{text}</Text>
{!!isSelected && <Icon name="check" size={22} style={{ color }} />}
</TouchableOpacity>
<Divider />
</>
);
};
export default PickerItemRow;