All files / form FormValidationMessage.js

100% Statements 5/5
100% Branches 6/6
100% Functions 1/1
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40            1x 2x 2x                     1x             1x                          
import React, { PropTypes } from 'react';
import { StyleSheet, View } from 'react-native';
import colors from '../config/colors';
import Text from '../text/Text';
import normalize from '../helpers/normalizeText';
 
const FormValidationMessage = props => {
  const {containerStyle, labelStyle, children, fontFamily, ...attributes} = props;
  return (
    <View style={[styles.container, containerStyle && containerStyle]} {...attributes}>
      <Text style={[
        styles.label,
        labelStyle && labelStyle,
        fontFamily && {fontFamily}
      ]}>{children}</Text>
    </View>
  );
};
 
FormValidationMessage.propTypes = {
  containerStyle: View.propTypes.style,
  labelStyle: View.propTypes.style,
  children: PropTypes.any,
  fontFamily: PropTypes.string,
};
 
const styles = StyleSheet.create({
  container: {},
  label: {
    marginLeft: 20,
    marginRight: 20,
    marginTop: 5,
    marginBottom: 1,
    color: colors.error,
    fontSize: normalize(12),
  }
});
 
export default FormValidationMessage;