mirror of
https://gitlab.com/wheres-the-tp/ui-mobile.git
synced 2026-01-25 06:04:55 -06:00
28 lines
821 B
JavaScript
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;
|