react-native-tableview-simple
Version:
React Native component for TableView made with pure CSS
40 lines • 1.48 kB
JavaScript
import React, { useContext } from 'react';
import { Platform, SafeAreaView, StyleSheet, View, } from 'react-native';
import { ThemeContext } from './Theme';
const Separator = ({ backgroundColor, tintColor, isHidden = false, insetLeft = 15, insetRight = 0, withSafeAreaView = Platform.OS === 'ios'
? parseInt(`${Platform.Version}`, 10) <= 10
? false
: true
: true, }) => {
const theme = useContext(ThemeContext);
const localStyles = {
separator: [
styles.separator,
{ backgroundColor: backgroundColor || theme.colors.background },
],
separatorInner: [
styles.separatorInner,
{
backgroundColor: isHidden
? 'transparent'
: tintColor || theme.colors.separatorColor,
marginLeft: insetLeft,
marginRight: insetRight,
},
],
};
if (withSafeAreaView) {
return (React.createElement(SafeAreaView, { style: localStyles.separator },
React.createElement(View, { style: localStyles.separatorInner })));
}
return (React.createElement(View, { style: localStyles.separator },
React.createElement(View, { style: localStyles.separatorInner })));
};
const styles = StyleSheet.create({
separator: {},
separatorInner: {
height: StyleSheet.hairlineWidth,
},
});
export default Separator;
//# sourceMappingURL=Separator.js.map