vn-verdnaturachat/app/containers/UIKit/MultiSelect/Input.js

37 lines
1.0 KiB
JavaScript
Raw Normal View History

2020-02-11 14:01:35 +00:00
import React from 'react';
import { View } from 'react-native';
import PropTypes from 'prop-types';
import Touchable from 'react-native-platform-touchable';
import { CustomIcon } from '../../../lib/Icons';
import { themes } from '../../../constants/colors';
import ActivityIndicator from '../../ActivityIndicator';
import styles from './styles';
const Input = ({
children, open, theme, loading
}) => (
<Touchable
onPress={() => open(true)}
style={{ backgroundColor: themes[theme].backgroundColor }}
background={Touchable.Ripple(themes[theme].bannerBackground)}
>
<View style={[styles.input, { borderColor: themes[theme].separatorColor }]}>
{children}
{
loading
? <ActivityIndicator style={[styles.loading, styles.icon]} />
: <CustomIcon name='arrow-down' size={22} color={themes[theme].auxiliaryText} style={styles.icon} />
}
</View>
</Touchable>
);
Input.propTypes = {
children: PropTypes.node,
open: PropTypes.func,
theme: PropTypes.string,
loading: PropTypes.bool
};
export default Input;