@dokuhero/react-native-components
Version:
Sets of React Native components that works with dokuhero/react-native-theme and react-i18next
25 lines • 1.23 kB
JavaScript
import * as tslib_1 from "tslib";
import { withTheme } from '@dokuhero/react-native-theme';
import React from 'react';
import { FormInput } from 'react-native-elements';
import { globalStyles } from '../styles';
import { FormField } from './FormField';
import { StaticField } from './StaticField';
export var Input = withTheme(function (_a) {
var theme = _a.theme, label = _a.label, errors = _a.errors, inputStyle = _a.inputStyle, disabled = _a.disabled, rest = tslib_1.__rest(_a, ["theme", "label", "errors", "inputStyle", "disabled"]);
if (disabled) {
return (<StaticField label={label} value={rest.value || ''} labelStyle={rest.labelStyle} containerStyle={rest.containerStyle} valueStyle={inputStyle}/>);
}
return (<FormField label={label} errors={errors} containerStyle={{ paddingBottom: 4 }}>
<FormInput underlineColorAndroid={theme.color.grey} {...rest} inputStyle={[
{
paddingHorizontal: 5,
color: theme.color.darker,
width: '100%'
},
globalStyles.inputText,
inputStyle
]} containerStyle={[globalStyles.container, rest.containerStyle]}/>
</FormField>);
});
//# sourceMappingURL=Input.js.map