All files / divider Divider.js

100% Statements 5/5
50% Branches 1/2
100% Functions 1/1
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22        3x   3x   3x       3x                  
import React from 'react';
import { View, StyleSheet } from 'react-native';
import ViewPropTypes from '../config/ViewPropTypes';
 
const Divider = ({ style }) => <View style={[styles.container, style]} />;
 
const hairlineWidth = StyleSheet.hairlineWidth;
 
Divider.propTypes = {
  style: ViewPropTypes.style,
};
 
const styles = StyleSheet.create({
  container: {
    // Darker color if hairlineWidth is not thin enough
    backgroundColor: hairlineWidth < 1 ? '#BCBBC1' : 'rgba(0, 0, 0, 0.12)',
    height: hairlineWidth,
  },
});
 
export default Divider;