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

40 lines
1.1 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, inputStyle, disabled
2020-02-11 14:01:35 +00:00
}) => (
<Touchable
onPress={() => open(true)}
style={[{ backgroundColor: themes[theme].backgroundColor }, inputStyle]}
2020-02-11 14:01:35 +00:00
background={Touchable.Ripple(themes[theme].bannerBackground)}
disabled={disabled}
2020-02-11 14:01:35 +00:00
>
<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,
inputStyle: PropTypes.object,
disabled: PropTypes.bool,
2020-02-11 14:01:35 +00:00
loading: PropTypes.bool
};
export default Input;