UNPKG

@eslam-elmeniawy/react-native-common-components

Version:

Common `ReactNative` components packed in library for usage in projects.

62 lines (59 loc) 1.36 kB
"use strict"; // External imports. import * as React from 'react'; import { StyleSheet } from 'react-native'; // Types imports. // Internal imports. import styles from "./TextInput.styles.js"; import { Text } from "../Text/index.js"; import { jsx as _jsx } from "react/jsx-runtime"; const ErrorView = /*#__PURE__*/React.memo(props => { const { errorProps, theme, style: inputStyle } = props; const { errorMessage, textProps } = errorProps ?? {}; if (errorMessage) { const { type, style, ...rest } = textProps ?? {}; const { marginVertical, marginBottom, width, marginHorizontal, marginStart, marginEnd, marginLeft, marginRight, alignSelf } = inputStyle ?? {}; const _widthHorizontalMarginStyle = { width, marginHorizontal, marginStart, marginEnd, marginLeft, marginRight, alignSelf }; return /*#__PURE__*/_jsx(Text, { type: type ?? 'caption', style: StyleSheet.flatten([styles.noVerticalMargin, { color: theme.colors.error, marginBottom: marginVertical ?? marginBottom }, _widthHorizontalMarginStyle, style]), ...rest, children: errorMessage }); } return null; }); export default ErrorView; //# sourceMappingURL=ErrorView.js.map