UNPKG

react-native-flex-grid

Version:

🎨 A react-native flexbox grid similar to bootstap's web grid.

31 lines (30 loc) • 998 B
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } import React from 'react'; import { StyleSheet, View } from 'react-native'; import { getConfig } from '../../../utils/grid'; const styles = StyleSheet.create({ row: { flexDirection: 'row', flexWrap: 'wrap' }, rtl: { flexDirection: 'row-reverse' } }); /** Row */ const Row = _ref => { let { style, gx = 4, dir = 'ltr', Element = View, ...rest } = _ref; return /*#__PURE__*/React.createElement(Element, _extends({ style: [styles.row, dir === 'rtl' && styles.rtl, gx && { marginHorizontal: -1 * getConfig().gutters[gx] / 2 }, style] }, rest)); }; export default Row; //# sourceMappingURL=Row.js.map